Changeset 1894 in orxonox.OLD for orxonox/branches/gui/guicc/orxonox_gui.cc
- Timestamp:
- May 18, 2004, 11:02:07 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/gui/guicc/orxonox_gui.cc
r1893 r1894 5 5 gtk_init (&argc, &argv); 6 6 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 (); 9 15 10 16 gtk_main(); 11 17 return 0; 12 18 } 19 20 21 /* WIDGET */ 22 void Widget::show() 23 { 24 gtk_widget_show (widget); 25 } 26 27 void 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 34 void 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 */ 13 43 14 44 Window::Window (void) … … 23 53 gtk_window_set_policy(GTK_WINDOW(widget), TRUE, TRUE, TRUE); 24 54 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);28 55 } 29 56 … … 31 58 {} 32 59 33 void Window::show ()60 void Window::showall () 34 61 { 35 62 gtk_widget_show_all (widget); … … 41 68 } 42 69 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 }47 70 48 71 49 gint orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data)72 gint Window::orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data) 50 73 { 51 74 gtk_main_quit(); 52 75 return FALSE; 53 76 } 77 78 79 /* FRAME */ 80 81 Frame::Frame (void) 82 { 83 widget = gtk_frame_new (""); 84 } 85 Frame::Frame (char* title) 86 { 87 widget = gtk_frame_new (title); 88 } 89 Frame::~Frame () 90 {} 91 92 void 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.