- Timestamp:
- Jun 17, 2004, 10:40:11 AM (20 years ago)
- Location:
- orxonox/branches/gui/guicc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/gui/guicc/orxonox_gui.cc
r1964 r1965 37 37 void Widget::connectSignal (char* event, gint ( *signal)( GtkWidget*, GdkEvent*, void *)) 38 38 { 39 cout <<(void*) this <<endl; 40 g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), (void*)this); 39 g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL); 40 } 41 42 void Widget::connectSignal (char* event, gint ( *signal)( GtkWidget*, Widget *)) 43 { 44 g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), this); 41 45 } 42 46 … … 149 153 150 154 /* SLIDER */ 151 Slider::Slider (char 155 Slider::Slider (char* slidername, int start, int end) 152 156 { 153 157 widget = gtk_hscale_new_with_range (start, end, 5); 154 i =3; 158 value = start; 159 option_name = slidername; 155 160 } 156 161 157 gint Slider::OptionChange (GtkWidget *widget, GdkEvent *event, void* data)162 gint Slider::OptionChange (GtkWidget *widget, Widget* slider) 158 163 { 159 cout << data << endl; 160 Slider* test = (Slider*)data; 161 162 //cout << (int)gtk_range_get_value (GTK_RANGE(test->widget)) << endl; 164 //Slider * superslider = dynamic_cast<Slider*>(slider) 165 // dynamic_cast<Slider*>(slider)->value = (int)gtk_range_get_value (GTK_RANGE((Slider*)slider->widget)); 166 cout << (int)gtk_range_get_value (GTK_RANGE((Slider*)slider->widget)) << endl; 163 167 } -
orxonox/branches/gui/guicc/orxonox_gui.h
r1964 r1965 23 23 //virtual void create (); 24 24 // void addWidget (); 25 void connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *)); 26 void show (); 25 void connectSignal (char* event, gint (*signal)( GtkWidget*, GdkEvent*, void *)); 26 void connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *)); 27 void show (); 27 28 }; 28 29 … … 78 79 class Option : public Widget 79 80 { 81 public: 80 82 //virtual gint OptionChange (GtkWidget *widget, GdkEvent *event, gpointer data); 83 84 int value; 85 char *option_name; 81 86 }; 82 87 … … 101 106 ~Slider(); 102 107 int i; 103 static gint OptionChange (GtkWidget *widget, GdkEvent *event, void* data);108 static gint OptionChange (GtkWidget *widget, Widget* slider); 104 109 }; 105 110 //gint orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data);
Note: See TracChangeset
for help on using the changeset viewer.