diff options
Diffstat (limited to 'perl-install/interactive.pm')
0 files changed, 0 insertions, 0 deletions
![]() |
index : drakx | |
Mageia Installer and base platform for many utilities | Thierry Vignaud [tv] |
summaryrefslogtreecommitdiffstats |
package my_gtk; # $Id$
use diagnostics;
use strict;
use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $border);
@ISA = qw(Exporter);
%EXPORT_TAGS = (
helpers => [ qw(create_okcancel createScrolledWindow create_menu create_notebook create_packtable create_hbox create_vbox create_adjustment create_box_with_title create_treeitem) ],
wrappers => [ qw(gtksignal_connect gtkradio gtkpack gtkpack_ gtkpack__ gtkpack2 gtkpack2_ gtkpack2__ gtkpowerpack gtkset_editable gtksetstyle gtkset_tip gtkappenditems gtkappend gtkset_shadow_type gtkset_layout gtkset_relief gtkadd gtkput gtktext_insert gtkset_usize gtksize gtkset_justify gtkset_active gtkset_sensitive gtkset_visibility gtkset_modal gtkset_border_width gtkmove gtkresize gtkshow gtkhide gtkdestroy gtkcolor gtkset_mousecursor gtkset_mousecursor_normal gtkset_mousecursor_wait gtkset_background gtkset_default_fontset gtkctree_children gtkxpm gtkpng create_pix_text get_text_coord fill_tiled gtkicons_labels_widget write_on_pixmap gtkcreate_xpm gtkcreate_png gtkbuttonset create_pixbutton gtkroot gtkentry) ],
ask => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_browse_tree_info ask_browse_tree_info_given_widgets ask_dir) ],
various => [ qw(add_icon_path) ],
);
$EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ];
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
use ugtk qw(:helpers :wrappers :various);
use common;
use log;
add_icon_path(@ugtk::icon_paths, "$ENV{SHARE_PATH}/libDrakX/pixmaps", '/usr/lib/libDrakX/icons', 'standalone/icons');
my $forgetTime = 1000; #- in milli-seconds
$border = 5;
#-###############################################################################
#- OO stuff
#-###############################################################################
sub new {
my ($type, $title, %opts) = @_;
Gtk->set_locale;
my $o = bless { %opts }, $type;
$o->_create_window($title);
while (my $e = shift @tempory::objects) { $e->destroy }
foreach (@interactive::objects) {
$_->{rwindow}->set_modal(0) if $_->{rwindow}->can('set_modal');
}
push @interactive::objects, $o if !$opts{no_interactive_objects};
$o->{rwindow}->set_position('center_always') if $::isStandalone;
$o->{rwindow}->set_modal(1) if $my_gtk::grab || $o->{grab};
if ($::isWizard && !$my_gtk::pop_it) {
$o->{isWizard} = 1;
$o->{window} = new Gtk::VBox(0,0);
$o->{window}->set_border_width($::Wizard_splash ? 0 : 10);
$o->{rwindow} = $o->{window};
if (!defined($::WizardWindow)) {
$::WizardWindow = new Gtk::Window;
$::WizardWindow->set_position('center_always');
$::WizardWindow->signal_connect(delete_event => sub { die 'wizcancel' });
$::WizardTable = new Gtk::Table(2, 2, 0);
$::WizardWindow->add($::WizardTable);
my $draw1 = new Gtk::DrawingArea;
$draw1->set_usize(540,100);
my $draw2 = new Gtk::DrawingArea;
$draw2->set_usize(100,300);
my ($im_up, $_mask_up) = gtkcreate_png($::Wizard_pix_up || "wiz_default_up.png");
my ($y1, $x1) = $im_up->get_size;
my ($im_left, $_mask_left) = gtkcreate_png($::Wizard_pix_left || "wiz_default_left.png");
my ($y2, $x2) = $im_left->get_size;
my $style = $draw1->style->copy();
$style->font(Gtk::Gdk::Font->fontset_load(N("-adobe-utopia-regular-r-*-*-25-*-*-*-p-*-iso8859-*,*-r-*")));
$draw1->signal_connect(expose_event => sub {
for (my $i = 0; $i < 540/$y1; $i++) {
$draw1->window->draw_pixmap($draw1->style->bg_gc('normal'),
$im_up, 0, 0, 0, $y1*$i,
$x1, $y1);
$draw1->window->draw_string(
$style->font,
$draw1->style->white_gc,
40, 62,
($::Wizard_title));
}
});
$draw2->signal_connect(expose_event => sub {
for (my $i = 0; $i < 300/$y2; $i++) {
$draw2->window->draw_pixmap($draw2->style->bg_gc('normal'),
$im_left, 0, 0, 0, $y2*$i,
$x2, $y2);
}
});
$::WizardTable->attach($draw1, 0, 2, 0, 1, 'fill', 'fill', 0, 0);
#- $::WizardTable->attach($draw2, 0, 1, 1, 2, 'fill', 'fill', 0, 0);
$::WizardTable->set_usize(540,420);
$::WizardWindow->show_all;
flush();
}
$::WizardTable->attach($o->{window}, 0, 2, 1, 2, ['fill', 'expand'], ['fill', 'expand'], 0, 0);
}
if ($::isEmbedded && !$my_gtk::pop_it && !eval { $::Plug && $::Plug->child }) {
$o->{isEmbedded} = 1;
$o->{window} = new Gtk::HBox(0,0);
$o->{rwindow} = $o->{window};
$::Plug ||= new Gtk::Plug($::XID);
$::Plug->show;
flush();
$::Plug->add($o->{window});
}
$o;
}
sub main {
my ($o, $completed, $canceled) = @_;
gtkset_mousecursor_normal();
$::CCPID and kill 'USR2', $::CCPID;
my $timeout = Gtk->timeout_add(1000, sub { gtkset_mousecursor_normal(); 1 });