# HG changeset patch # User Peter Gervai # Date 1224148183 -7200 # Node ID 43c199fb199351715dff1cd47de4164c4a9b5780 glade perl test, first import diff -r 000000000000 -r 43c199fb1993 test1.glade --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test1.glade Thu Oct 16 11:09:43 2008 +0200 @@ -0,0 +1,158 @@ + + + + + + 5 + GTK_WIN_POS_CENTER_ON_PARENT + GDK_WINDOW_TYPE_HINT_DIALOG + False + + + True + 2 + + + True + + + True + + + True + gtk-dialog-info + 6 + + + + + True + True + I'll explain what this is about. + Please enter your name +in the stuffy thingy +below this + True + + + 1 + + + + + + + True + True + True + This is your name, pal. + 15 + True + Bob + + + + + 1 + + + + + 1 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-about + GTK_RELIEF_HALF + True + False + 0 + + + True + + + + + True + True + True + True + Something's screwed + _Nay + True + 2 + + + 1 + + + + + True + True + True + True + We're good + gtk-ok + True + 1 + + + 2 + + + + + False + GTK_PACK_END + + + + + + + 5 + About Test #1 + GTK_WIN_POS_CENTER_ON_PARENT + True + GDK_WINDOW_TYPE_HINT_DIALOG + False + Test #1 + v1.00 + (c)grin 2008 + All revisions reversed. + http://hg.grin.hu/test + The Website + Licensed under RSSL (Really Scary Shit License) + grin, others not + grin + + + True + 2 + + + + + + True + GTK_BUTTONBOX_END + + + False + GTK_PACK_END + + + + + + diff -r 000000000000 -r 43c199fb1993 test1.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test1.pl Thu Oct 16 11:09:43 2008 +0200 @@ -0,0 +1,37 @@ +#!/usr/bin/perl -w +#$Id$ +# + +use strict; +use warnings; + +use Gtk2 '-init'; +use Gtk2::GladeXML; +use Gtk2::Gdk::Keysyms; # keyboard code constants + +my $glade; +my $label; +my $field; +my $window_about; + +# load UI +$glade = Gtk2::GladeXML->new("test1.glade"); + +# connect signals +$glade->signal_autoconnect_from_package('main'); + +$label = $glade->get_widget('label1'); +$field = $glade->get_widget('yourname_field'); +$window_about = $glade->get_widget('aboutdialog1'); + +Gtk2->main; + +exit 0; + + + +# Handles window-manager-quit: shuts down gtk2 lib +sub on_main_delete_event {Gtk2->main_quit;} + +# Handles close-button quit +sub on_close_button_clicked {on_main_delete_event;}