Re: Gtk2-perl shell (problem with GLib-GObject)



On Tue, Jan 11, 2005 at 01:40:01PM +0100, Remco Wouts wrote:
Hi all,

I wrote a small Gtk2 shell. The attached code is the gist of it[1]. You 
can do things like:
 gish> Gtk2::Window->new->add(Gtk2::Button->new('foobar'))->show_all
The idea is that you can create a package App.pm and continuously 
edit-reload-inspect it by doing:
 gish> do 'App.pm'
 gish> $app=App->new
 ....
 gish> $app->destroy

I can't help with your issue, but this reminded me to pass on the
way I handle edit-reload-inspect for a glade based app:

Glib::Timeout->add(500, sub { # auto-restart if glade file changes
    return 1 unless (-M $glade_file) < 0;
    Gtk2->main_quit;
    exec "perl", $0, @ORIG_ARGV or die "Can't exec $0: $!";
});

Tim.



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