Re: explicit signal connection vs. overriding function



Muchas gracias, José.

That was very helpful. Lots to read.

Good night.



----- Original Message ----
From: José Alburquerque <jaalburquerque cox net>
To: Piscium <groknok yahoo ie>
Cc: gtkmm-list gnome org
Sent: Mon, 10 May, 2010 22:54:58
Subject: Re: explicit signal connection vs. overriding function

On Mon, 2010-05-10 at 17:37 -0400, José Alburquerque wrote:
> On Mon, 2010-05-10 at 20:50 +0000, Piscium wrote:
> > And what are the advantages of each way of connecting signals?
> > 
> > It seems to me that overriding a signal method requires less typing, and results perhaps in more readable code.
> > 
> > On the other hand, the method on_expose_event used in DrawingArea is protected, so one can override it only if one derives from DrawingArea, which may not be always expedient.
> > 
> > Are there any other advantages and disadvantages?
> > 
> > And are there any subtle semantic differences between the two ways? I would assume that overriding the signal method somehow causes the signal to be connected behind the scenes, though I have no clue how that would be done.
> > 
> 
> One difference from connecting versus deriving is that with connecting,
> it is possible to use connect_notify() instead of connect() which allows
> controlling whether the handler will be called before or after the
> default signal handler:
> 
> http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1SignalProxy1.html#a1dd40d7c3475124bb78053805fbde3f8

I should have added that the online book has a good section on this:

http://library.gnome.org/devel/gtkmm-tutorial/unstable/chapter-signals.html.en

-- 
José





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