Stealing a good idea from Gtk#


have you ever seen the cool syntax the Gtk# people use for connecting
signals?  No?  Well, I have -- and I was jealous.  It looks like this:

  editable.Toggled += new EventHandler (OnEditableToggled);

Well, while brushing my teeth I had an idea.

One hour and fifty lines of Perl later, the attached was
finished.  Some sample usage:

  use Foo qw(Gtk2::Button Gtk2::Widget);

  $button -> Clicked += \&clicked;

  $window -> DeleteEvent += sub {
    Gtk2 -> main_quit();
    return FALSE;

Cool, eh?  That looks even better than the Gtk# stuff.  I just love

I used studly caps for the signal names because if you use the orignal
names you get collisions with existing methods like

Now I just need a name for this baby since "Foo" isn't all that
descriptive.  Any suggestions?


Description: Perl program

Description: Perl program

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