gtk-- listitem/button-press signal question



I've got a window with list in it and I want one of the
Window's member functions to be called when an item in the
list is double clicked. I've added a callback function with
what looks like the right signature to my window class, but 
I can't figure out how to get it connected to the button event.
The compiler does not like my connect() call one bit! 

Below is a rough approximation of my current code: can anybody 
tell me what I am doing wrong? Am I even on the right track 
with this?

class MyWindow : public Gtk_Window {
...
private:
   Gtk_List* mylist;
public:
   int onButtonPress(gint i, Gtk_Widget w,GdkEventButton* evt) {
      // Check event type to see if it was a double click
   }
   MyWindow() {
      ...
      Gtk_ListItem* item1 = new Gtk_ListItem("Item1");
      mylist->add(item1);
      connect( item1->button_press_event, *this,
         &Gfm_Window::onButtonPress );
      ... 
  }
...
}

-- 
David M. Johnson
snoopdave at geocities.com
johnson at roguewave.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]