--- /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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.5 on Thu Oct 16 11:06:53 2008 -->
+<glade-interface>
+ <widget class="GtkDialog" id="dialog1">
+ <property name="border_width">5</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-dialog-info</property>
+ <property name="icon_size">6</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_text">I'll explain what this is about.</property>
+ <property name="label" translatable="yes">Please enter your name
+in the stuffy thingy
+below this</property>
+ <property name="wrap">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="yourname_field">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_text">This is your name, pal.</property>
+ <property name="max_length">15</property>
+ <property name="activates_default">True</property>
+ <property name="text" translatable="yes">Bob</property>
+ <signal name="activate" handler="on_in_yourname_activate"/>
+ <signal name="key_release_event" handler="on_yourname_field_key_release_event"/>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="about_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">gtk-about</property>
+ <property name="relief">GTK_RELIEF_HALF</property>
+ <property name="use_stock">True</property>
+ <property name="focus_on_click">False</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="nay_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_text">Something's screwed</property>
+ <property name="label" translatable="yes" context="yes">_Nay</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">2</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="ok_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_text">We're good</property>
+ <property name="label" translatable="yes" context="yes">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">1</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkAboutDialog" id="aboutdialog1">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">About Test #1</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <property name="program_name">Test #1</property>
+ <property name="version">v1.00</property>
+ <property name="copyright" translatable="yes">(c)grin 2008</property>
+ <property name="comments" translatable="yes">All revisions reversed.</property>
+ <property name="website">http://hg.grin.hu/test</property>
+ <property name="website_label" translatable="yes">The Website</property>
+ <property name="license" translatable="yes">Licensed under RSSL (Really Scary Shit License)</property>
+ <property name="authors">grin, others not</property>
+ <property name="artists">grin</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
--- /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;}