Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1964 in orxonox.OLD


Ignore:
Timestamp:
Jun 17, 2004, 1:54:59 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/gui/guicc: added OptionChange-procedure. But until now it does not work correctly.

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

Legend:

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

    r1962 r1964  
    11#include "orxonox_gui.h"
     2#include <iostream.h>
     3
    24
    35int main( int argc, char *argv[] )
     
    1719    box->fill(button);
    1820    Slider* slider = new Slider("testslider", 0, 100);
     21    slider->connectSignal ("value_changed", slider->OptionChange);
    1922    box->fill(slider);
    2023
     
    3437void Widget::connectSignal (char* event, gint ( *signal)( GtkWidget*, GdkEvent*, void *))
    3538{
    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);
    3741}
    3842
     
    145149
    146150/* SLIDER */
    147 Slider::Slider (char * slidername,int start, int end)
     151Slider::Slider (char * slidername, int start, int end)
    148152{
    149153  widget = gtk_hscale_new_with_range (start, end, 5);
     154  i =3;
    150155}
     156
     157gint 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  
    22#define _ORXONOX_GUI_H
    33
    4 #include <stdio.h>
    54#include <stdlib.h>
    65#include <string.h>
     
    7978class Option : public Widget
    8079{
     80  //virtual gint OptionChange (GtkWidget *widget, GdkEvent *event, gpointer data);
    8181};
    8282
    83 class Button : public Option
     83class Button : public Option 
    8484{
    8585 public:
     
    100100  Slider (char * slidername,int start, int end);
    101101  ~Slider();
     102  int i;
     103  static gint OptionChange (GtkWidget *widget, GdkEvent *event, void* data);
    102104};
    103105//gint orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data);
Note: See TracChangeset for help on using the changeset viewer.