From 43378c48c4ea689d1e687e4e7122dc0b3372e963 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Thu, 19 Apr 2012 03:58:59 +0000 Subject: add gtk3 version of display_help --- perl-install/standalone/display_help_gtk3 | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 perl-install/standalone/display_help_gtk3 diff --git a/perl-install/standalone/display_help_gtk3 b/perl-install/standalone/display_help_gtk3 new file mode 100755 index 000000000..cbecfa75e --- /dev/null +++ b/perl-install/standalone/display_help_gtk3 @@ -0,0 +1,72 @@ +#!/usr/bin/perl + +# Display Help (gtk3 version) +# Funda Wang +# +# This program 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 2, or (at your option) +# any later version. +# +# This program 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 this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +use lib qw(/usr/lib/libDrakX); +use common; +use any; +use Encode qw/ encode decode /; +use Gtk3 -init; +use Gtk3::WebKit; +my $wm = any::running_window_manager(); +my $is_firstime = to_bool($wm =~ /drakx-matchbox-window-manager/); + +my $view = Gtk3::WebKit::WebView->new(); +$view->load_uri($ARGV[0]); +my $settings = $view->get_settings (); +$settings->set_property('enable-default-context-menu',0); +$view->set_settings ($settings); +$view->signal_connect('close-web-view' => sub { Gtk3->main_quit() }); + +my $scrolls = Gtk3::ScrolledWindow->new(); +$scrolls->add($view); + +my $button = Gtk3::Button->new_from_stock('gtk-close'); +$button->signal_connect(clicked => sub { Gtk3->main_quit() }); + +my $window = Gtk3::Window->new(GTK_WINDOW_TOPLEVEL); +$window->signal_connect(destroy => sub { Gtk3->main_quit() }); +$window->set_title(decode("UTF8", N("Help"))); +$window->set_border_width(5); +if (!$is_firstime) { + $window->set_default_size(840, 600); +} else { + $window->full_screen(); +} + +my $vbox = Gtk3::Box->new(GTK_ORIENTATION_VERTICAL, 3); +$vbox->pack_start(Gtk3::Separator->new(GTK_ORIENTATION_HORIZONTAL), 0, 0, 0); +if (!$is_firstime) { + my $label = Gtk3::Label->new('Help'); + $label->set_markup (''.decode("UTF8", N("Help")).''); + my $hbox1 = Gtk3::Box->new(GTK_ORIENTATION_HORIZONTAL, 1); + $hbox1->pack_start($label, 0, 0, 0); + $vbox->pack_start($hbox1, 0, 0,0); + $vbox->pack_start(Gtk3::Separator->new(GTK_ORIENTATION_HORIZONTAL), 0, 0, 0); +} +$vbox->pack_start($scrolls, TRUE, TURE, 5); +$vbox->pack_start(Gtk3::Separator->new(GTK_ORIENTATION_HORIZONTAL), 0, 0, 0); +if (!$is_firstime) { + my $hbox2 = Gtk3::Box->new(GTK_ORIENTATION_HORIZONTAL, 1); + $hbox2->pack_end($button, 0,0,5); + $vbox->pack_end($hbox2, 0, 0, 0); +} + +$window->add($vbox); +$window->show_all(); +Gtk3->main(); -- cgit v1.2.1