What is the difference between 'signal_{event}' and 'on_{event}'?



Hi,

I'm a little confused on connecting a member function by 'signal_{event}().connect()' and override 'on_{event}()' function.

Say Gtk::Widget as an example, if I want to do something when 'show' event happened, I will create a member function, on_my_show(), and connect it to signal_show(). However, I also found a virtual member function in the API, on_show(). It looks likely can be overrideed and do the samething as previous on_my_show(). I'm not sure, but I guess that I do not need to connect to the signal_show() by myself, it should be already connected by Gtk::Window() constructor.

So, could anyone make me clear, when should we create our own member function and connect it to the signal? and when should we just override the 'on_{event}' virtual function inherited from parent's class? Thanks in advance.

--
Regards

Tao Wang


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