Changeset 1964 in orxonox.OLD
- Timestamp:
- Jun 17, 2004, 1:54:59 AM (20 years ago)
- Location:
- orxonox/branches/gui/guicc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/gui/guicc/orxonox_gui.cc
r1962 r1964 1 1 #include "orxonox_gui.h" 2 #include <iostream.h> 3 2 4 3 5 int main( int argc, char *argv[] ) … … 17 19 box->fill(button); 18 20 Slider* slider = new Slider("testslider", 0, 100); 21 slider->connectSignal ("value_changed", slider->OptionChange); 19 22 box->fill(slider); 20 23 … … 34 37 void Widget::connectSignal (char* event, gint ( *signal)( GtkWidget*, GdkEvent*, void *)) 35 38 { 36 g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL); 39 cout <<(void*) this <<endl; 40 g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), (void*)this); 37 41 } 38 42 … … 145 149 146 150 /* SLIDER */ 147 Slider::Slider (char * slidername, int start, int end)151 Slider::Slider (char * slidername, int start, int end) 148 152 { 149 153 widget = gtk_hscale_new_with_range (start, end, 5); 154 i =3; 150 155 } 156 157 gint Slider::OptionChange (GtkWidget *widget, GdkEvent *event, void* data) 158 { 159 cout << data << endl; 160 Slider* test = (Slider*)data; 161 162 //cout << (int)gtk_range_get_value (GTK_RANGE(test->widget)) << endl; 163 } -
orxonox/branches/gui/guicc/orxonox_gui.h
r1962 r1964 2 2 #define _ORXONOX_GUI_H 3 3 4 #include <stdio.h>5 4 #include <stdlib.h> 6 5 #include <string.h> … … 79 78 class Option : public Widget 80 79 { 80 //virtual gint OptionChange (GtkWidget *widget, GdkEvent *event, gpointer data); 81 81 }; 82 82 83 class Button : public Option 83 class Button : public Option 84 84 { 85 85 public: … … 100 100 Slider (char * slidername,int start, int end); 101 101 ~Slider(); 102 int i; 103 static gint OptionChange (GtkWidget *widget, GdkEvent *event, void* data); 102 104 }; 103 105 //gint orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data);
Note: See TracChangeset
for help on using the changeset viewer.