diff options
author | Christian Pointner <equinox@helsinki.at> | 2010-02-20 19:27:50 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2010-02-20 19:27:50 (GMT) |
commit | 9a10f30cdb0484bfbff270d214dc05b862072dc7 (patch) | |
tree | eeb12070b1df3e187bf99e3156a55a9880b3143b | |
parent | 6ebda554bb37c1a08f16ff80ba0fa504c601ae35 (diff) |
added gui signals callbacks
git-svn-id: https://svn.helsinki.at/rhimport/trunk@7 7c65635b-ec39-4f67-a626-873dbafdd612
-rw-r--r-- | gui_callbacks.pm | 33 | ||||
-rw-r--r-- | rhimport.glade | 2 | ||||
-rwxr-xr-x | rhimport.pl | 22 |
3 files changed, 56 insertions, 1 deletions
diff --git a/gui_callbacks.pm b/gui_callbacks.pm new file mode 100644 index 0000000..2817b65 --- /dev/null +++ b/gui_callbacks.pm @@ -0,0 +1,33 @@ +#!/usr/bin/perl -w +# +# +# rhdropbox +# +# Copyright (C) 2009 Christian Pointner <equinox@helsinki.at> +# +# This file is part of rhdropbox. +# +# rhdropbox is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# any later version. +# +# rhdropbox is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with rhdropbox. If not, see <http://www.gnu.org/licenses/>. +# + +use strict; + +package gui_callbacks; + +sub on_exit() +{ + Gtk2->main_quit; +} + +1; diff --git a/rhimport.glade b/rhimport.glade index 4ed5a77..e573dcb 100644 --- a/rhimport.glade +++ b/rhimport.glade @@ -9,6 +9,7 @@ <property name="title">rhimport</property> <property name="gravity">center</property> <property name="startup_id">1</property> + <signal name="destroy" handler="on_exit"/> <child> <widget class="GtkFrame" id="mainframe"> <property name="visible">True</property> @@ -112,6 +113,7 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> + <signal name="clicked" handler="on_exit"/> </widget> <packing> <property name="expand">False</property> diff --git a/rhimport.pl b/rhimport.pl index 29eba44..dab8d63 100755 --- a/rhimport.pl +++ b/rhimport.pl @@ -1,6 +1,25 @@ #!/usr/bin/perl -w # # +# rhimport +# +# Copyright (C) 2009 Christian Pointner <equinox@helsinki.at> +# +# This file is part of rhimport. +# +# rhimport is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# any later version. +# +# rhimport is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with rhimport. If not, see <http://www.gnu.org/licenses/>. +# use strict; @@ -72,10 +91,11 @@ if(!$M3U) { my $guixml = Gtk2::GladeXML->new('rhimport.glade'); $guixml or die "can't load glade xml file"; + require gui_callbacks; + $guixml->signal_autoconnect_from_package('gui_callbacks'); my $appwin = $guixml->get_widget('appwin'); $appwin or die "can't find Main Window"; - $appwin->show; Gtk2->main; |