Where can I learn the advanced (Perl) design of Gtk2?

I have been working with Perl for many years and recently started to learn how to make a graphical interface through Gtk2. All the examples and tutorials that I found illustrate simple single-window applications. Everything in the second window is limited to a simple text entry or a yes / no dialog. I want to learn how to build something with this next step more difficult. I know how to create windows, etc. (Manually or through Glade), but I don’t understand how to link the program stream together.

I am ready to buy books, etc., but I only saw for C (and not in stock, I would have to order them invisible), and I'm worried about the differences with Perl :: Gtk2 can still add too much complexity. Can someone provide me an example or point me to a tutorial etc.

Thank you so much,

Adam

+5
source share
2 answers

I have been developing Perl / GTK for a couple of years now and I know what you're talking about. Gtk2 :: Ex :: FormFactory is a neat module, but it's really not my business and definitely not needed to create a complex Perl / GTK application. All widgets, including windows, in Perl / GTK support the show / hide method. In addition, you can have as many windows as you want, and just show and hide them as needed. Here is a simple example of switching between multiple windows:

#! / usr / bin / perl

use Glib qw / TRUE FALSE /;
use Gtk2 '-init';


$ window = Gtk2 :: Window-> new ('toplevel');
$ window-> signal_connect (delete_event => sub {Gtk2-> main_quit;});
$window->set_border_width(10);
$window->set_title("Window 1");
$window->set_position('center');
$button = Gtk2::Button->new("Switch to Window 2");
$button->signal_connect(clicked => sub {
    $window->hide;
    $window2->show;
});
$window->add($button);
$button->show;

$window2 = Gtk2::Window->new('toplevel');
$window2->signal_connect(delete_event => sub { Gtk2->main_quit; });
$window2->set_border_width(10);
$window2->set_title("Window 2");
$window2->set_position('center');
$button2 = Gtk2::Button->new("Switch to Window 1");
$button2->signal_connect(clicked => sub {
    $window2->hide;
    $window->show;
});
$window2->add($button2);
$button2->show;

$window->show;

Gtk2->main;
+2

Gtk2:: Ex:: FormFactory , Gtk, . Gtk2:: Ex:: FormFactory , . Gtk2:: Ex:: FormFactory Gtk2, Perl Gtk2 - C ( , perlish), C- Gtk , , perl Gtk + 2 Gtk + 2. . Gtk2:: api .

+1

All Articles