Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1965 in orxonox.OLD


Ignore:
Timestamp:
Jun 17, 2004, 10:40:11 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/gui/guicc: now whole objects can be passed by using signals

Location:
orxonox/branches/gui/guicc
Files:
2 edited

Legend:

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

    r1964 r1965  
    3737void Widget::connectSignal (char* event, gint ( *signal)( GtkWidget*, GdkEvent*, void *))
    3838{
    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
     42void Widget::connectSignal (char* event, gint ( *signal)( GtkWidget*, Widget *))
     43{
     44  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), this);
    4145}
    4246
     
    149153
    150154/* SLIDER */
    151 Slider::Slider (char * slidername, int start, int end)
     155Slider::Slider (char* slidername, int start, int end)
    152156{
    153157  widget = gtk_hscale_new_with_range (start, end, 5);
    154   i =3;
     158  value = start;
     159  option_name = slidername;
    155160}
    156161
    157 gint Slider::OptionChange (GtkWidget *widget, GdkEvent *event, void* data)
     162gint Slider::OptionChange (GtkWidget *widget, Widget* slider)
    158163{
    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;
    163167}
  • orxonox/branches/gui/guicc/orxonox_gui.h

    r1964 r1965  
    2323  //virtual void create ();
    2424  //  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 ();
    2728};
    2829
     
    7879class Option : public Widget
    7980{
     81 public:
    8082  //virtual gint OptionChange (GtkWidget *widget, GdkEvent *event, gpointer data);
     83 
     84  int value;
     85  char *option_name;
    8186};
    8287
     
    101106  ~Slider();
    102107  int i;
    103   static gint OptionChange (GtkWidget *widget, GdkEvent *event, void* data);
     108  static gint OptionChange (GtkWidget *widget, Widget* slider);
    104109};
    105110//gint orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data);
Note: See TracChangeset for help on using the changeset viewer.