Re: Questions about Gtkmm/Libglademm



On Sat, 2008-05-10 at 21:56 +0200, Timo wrote:
> But what I don't get from the examples is the glade signal handling.
> In
> Glade, I give all  widgets already a signal. So the close button gets:
> on_close_clicked. In Python/PyGTK this can be simply connected by
> making
> a dictionary, like:
>     dic = { "on_close_clicked" : gtk.main_quit }
>     self.wTree.signal_autoconnect(dic)
> containing all the signals.
> 
> But in the Libglademm examples, they always use lines of code for each
> widget to connect the signals, like:
>     Gtk::Button* pButton = 0;
>     refXml->get_widget("quit_button", pButton);
>     if(pButton)
>       pButton->signal_clicked().connect(
> sigc::ptr_fun(&on_button_clicked) );
> 
> Isn't there a way to read the signals set in the glade file? That
> would
> save some repeating code.

No because C++ is a static language that does not allow symbolic lookup
of methods.


Hub



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