Tutorial code converted to Perl



For my own elucidation, I'm converting the code in the tutorial to Perl.
Has anyone done this yet?

So far after a couple of hours I'm mostly done with chapter 4, but I'm not
making the effort to comment the code or make it pretty.  If this hasn't
been done before and someone wants the output I'll be happy to clean it up
a bit.

While I'm at it, what's the cleanest way to represent this:

  gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
                             GTK_SIGNAL_FUNC (gtk_main_quit),
                             GTK_OBJECT (window));
?  I'm using:

$button->signal_connect(clicked => sub {Gtk::main_quit($window)});

but it's not really pretty and I'm not sure that it's doing the right
thing.  Is there an equivalent to signal_connect_object that doesn't use a
coderef?

 - J<



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