Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1894 in orxonox.OLD for orxonox/branches/gui/guicc/orxonox_gui.cc


Ignore:
Timestamp:
May 18, 2004, 11:02:07 AM (21 years ago)
Author:
bensch
Message:

orxonox/branches/gui/guicc: updating for transfer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/gui/guicc/orxonox_gui.cc

    r1893 r1894  
    55    gtk_init (&argc, &argv);
    66    Window* orxonoxGUI = new Window("Graphical Orxonox Launcher");
    7     orxonoxGUI->connectSignal (orxonoxGUI, "destroy", orxonox_gui_quit);
    8     orxonoxGUI->show ();
     7    orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit);
     8    orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit);
     9
     10    Frame* Frametest = new Frame ("Test");
     11    orxonoxGUI->fill(Frametest);
     12    //Frame test = orxonoxGUI->down;
     13    //test.setTitle("shit");
     14    orxonoxGUI->showall ();
    915
    1016    gtk_main();
    1117    return 0;
    1218  }
     19
     20
     21/* WIDGET */
     22void Widget::show()
     23{
     24  gtk_widget_show (widget);
     25}
     26
     27void Widget::connectSignal (char* event, gint ( *signal)( GtkWidget*, GdkEvent*, void *))
     28{
     29  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL);
     30}
     31
     32 /* CONTAINERS*/
     33
     34void Container::fill (Widget *lowerWidget)
     35{
     36  gtk_container_add (GTK_CONTAINER(this->widget), lowerWidget->widget);
     37  this->down = lowerWidget;
     38}
     39
     40// gtk_container_set_border_width (GTK_CONTAINER (widget), 5);
     41
     42  /* WINDOW */
    1343
    1444Window::Window (void)
     
    2353  gtk_window_set_policy(GTK_WINDOW(widget), TRUE, TRUE, TRUE);
    2454  this->setTitle(windowName);
    25   //  g_signal_connect (G_OBJECT (widget), "delete_event", G_CALLBACK (gtk_main_quit), NULL);
    26   // g_signal_connect (G_OBJECT (widget), "destroy", G_CALLBACK (orxonox_gui_quit), orxonox_settings);
    27   // gtk_container_set_border_width (GTK_CONTAINER (widget), 5);
    2855}
    2956
     
    3158{}
    3259
    33 void Window::show ()
     60void Window::showall ()
    3461{
    3562  gtk_widget_show_all  (widget);
     
    4168}
    4269
    43 void Widget::connectSignal (Widget* thisWidget, char* event, gint ( *signal)( GtkWidget*, GdkEvent*, void *))
    44 {
    45   g_signal_connect (G_OBJECT (thisWidget->widget), event, G_CALLBACK (signal), NULL);
    46 }
    4770
    4871
    49 gint orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data)
     72gint Window::orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data)
    5073{
    5174  gtk_main_quit();
    5275  return FALSE;
    5376}
     77
     78
     79   /* FRAME */
     80
     81Frame::Frame (void)
     82{
     83  widget = gtk_frame_new ("");
     84}
     85Frame::Frame (char* title)
     86{
     87  widget = gtk_frame_new (title);
     88}
     89Frame::~Frame ()
     90{}
     91
     92void Frame::setTitle (char* title)
     93{
     94  gtk_frame_set_label (GTK_FRAME (widget), title);
     95}
Note: See TracChangeset for help on using the changeset viewer.