Re: Stealing a good idea from Gtk#
- From: Torsten Schoenfeld <kaffeetisch gmx de>
- To: gtk-perl-list gnome org
- Subject: Re: Stealing a good idea from Gtk#
- Date: Mon, 27 Sep 2004 10:12:02 +0200
On Mon, 2004-09-27 at 03:45, muppet wrote:
$button -> Clicked += \&clicked;
i presume you would disconnect a signal with the -= operator?
If somebody implemented it, yes. I think it should be as easy as
calling signal_handlers_disconnect_by_func.
what irks me the most about it is that, yes it's true that you're
adding a handler to the signal, but you're not doing a += operation. a
+= b makes sense where both a and b are "Foo"s. seen in that light,
something like
<signal> += <handler>
makes less sense. say you wanted to get the id from that connection.
you'd now have
<id> = <signal> += <handler>
which makes even *less* sense. shouldn't the resulting value of
Foo+=something still be a Foo?
You need to break the mold. Abandon what you already know. Go with the
flow!
how would you handle variants like connect-after and user data? the
obvious thing to come to mind is (using Aristotle's naming because
StudlyCaps suck)
User data isn't really necessary, as Aristotle pointed out. For
signal_connect_after, well, what about using »/=«?
The / kinda looks like a ramp which can be interpreted as a shoot. And
as we all know, the big kids (aka. the default handlers) always skid
first.
--
Bye,
-Torsten
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]