Re: Gtk2 docs/tutorials



Dieter Schicker wrote:
I'm new to Gtk2 (not to Perl) and I want to kindly ask if someone can
point me to some good docs/examples/tutorials about gtk2-perl. I looked
at the "official" ones but IMHO they are not very exhaustive for a
newcomer.

What I do is I look at the documentation for the C-api at developer.gnome.org and than kind of guess how this translates to perl (also there is an document about api translations). But also the C-api is not very exhaustive.

E.g. I'm trying to realize a button with an icon (not a stock icon) and
text in it. How can I do that?

Creat ea button without a label, put the label and the icon into a hbox and add the hbox to the button. Use an alignment object to line-out everything.

   $label = 'Foo';
   $icon = Gtk2::Image->new_from_file('foo.png');
   $hbox = Gtk2::HBox->new;
   $hbox->add($icon);
   $hbox->add($label);
   $align = Gtk2::Alignment->new(0.5,0.5, 0,0);
   $align->add($hbox);
   $button = Gtk2::Button->new();
   $button->add($align);
   $button->show_all;

Many thanks in advance
Dieter
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list




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