RE: [gtkmm] TreeView widget - Double-Click



That tells gtk to call your signal handler BEFORE theirs.  You should also
return something from on_button_press.

-Mike

> -----Original Message-----
> From: Sebastian Stark [mailto:stark sebastian gmx de]
> Sent: Thursday, December 19, 2002 6:02 AM
> To: gtkmm-list gnome org
> Subject: Re: [gtkmm] TreeView widget - Double-Click
> 
> 
> OK,
> I have written a little "HelloWorld" program with
> signal_button_press_event().
> Here is the source:
> But if press the button, nothing happens! What's wrong?
> 
> #include <gtkmm.h>
> #include <iostream>
> 
> using namespace std;
> 
> class HelloWorld : public Gtk::Window
> {
> public:
>         HelloWorld();
> 
>     protected:
>         Gtk::Button m_button;
> 
>     bool on_button_press(GdkEventButton *event)
>         {
>             cout << "pressed" << endl;
>         }
> };
> 
> HelloWorld::HelloWorld()
> : m_button("Hello World")
> {
>     add(m_button);
>     m_button.show();
>     m_button.signal_button_press_event().connect(SigC::slot(*this,
> &HelloWorld::on_button_press));
> }
> 
> int main (int argc, char *argv[])
> {
>     Gtk::Main kit(argc, argv);
> 
>     HelloWorld helloworld;
>     Gtk::Main::run(helloworld);
> 
>     return 0;
> }
> 
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 



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