Re: [ANNOUNCE] Tk::Gripes and Tk::SignalSlot

Ala Qumsieh <[email protected]>
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
--- Nick Ing-Simmons <[email protected]> wrote:

> Well :
>    A. There is nothing stopping that callback
> calling others.

Correct, but that adds unnecessary coupling between
otherwise unrelated pieces of code. It's not a real
problem, but can lead to some complicated code. For
Tcl/Tk, which is procedural, this is not an issue. But
for Perl/Tk, which has an object-oriented syntax, I
believe signals and slots can result in cleaner code
most of the time.

>    B. It isn't true
>         bind associates a callback with a tag 
>         when an event occurs Tk calls the callbacks
> - in sequence 
>         - for all the bindtags associate with the
> widget via bindtags.
> 
> So if you are writing a mega-widget you should bind
> to the class name
> of that implements it. And leave the specific
> instance name tag for 
> end-user use.
> 
> There is even a mechanism for a derived class to
> inherit bindings 
> from its base class(es)!

True. I wasn't thinking about bindtags. While very
powerful, bindtags can be confusing, and a pain to
work with. I haven't seen a similar concept in any
other toolkit. Perhaps I need to modify the article,
but I still believe that signals and slots are a very
convenient alternative to bindings.

--Ala


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.