summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-01-06 14:51:53 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-01-06 14:51:53 +0000
commit2bbb9d04afdcceb813d2aee457fdf6ad7241870e (patch)
tree7e11b6c43bdc1b8025f52d64d7f1f09816a15338
parent0555208bd918cb5a98bf0c3997b41eea36514d10 (diff)
downloaddrakx-2bbb9d04afdcceb813d2aee457fdf6ad7241870e.tar
drakx-2bbb9d04afdcceb813d2aee457fdf6ad7241870e.tar.gz
drakx-2bbb9d04afdcceb813d2aee457fdf6ad7241870e.tar.bz2
drakx-2bbb9d04afdcceb813d2aee457fdf6ad7241870e.tar.xz
drakx-2bbb9d04afdcceb813d2aee457fdf6ad7241870e.zip
merge Window and Dialog creation
-rw-r--r--perl-install/mygtk2.pm30
1 files changed, 11 insertions, 19 deletions
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm
index 2472d12a9..14e1d7c94 100644
--- a/perl-install/mygtk2.pm
+++ b/perl-install/mygtk2.pm
@@ -394,12 +394,20 @@ sub _gtk__Frame {
$w;
}
-sub _gtk__Window {
- my ($w, $opts) = @_;
+sub _gtk__Window { &_gtk_any_Window }
+sub _gtk__Dialog { &_gtk_any_Window }
+sub _gtk_any_Window {
+ my ($w, $opts, $class) = @_;
if (!$w) {
- $w = Gtk2::Window->new(delete $opts->{type} || 'toplevel');
+ if ($class eq 'Window') {
+ $w = "Gtk2::$class"->new(delete $opts->{type} || 'toplevel');
+ } else {
+ $w = "Gtk2::$class"->new;
+ }
+
$w->set_modal(delete $opts->{modal}) if exists $opts->{modal};
+ $w->set_transient_for(delete $opts->{transient_for}) if exists $opts->{transient_for};
$w->set_border_width(delete $opts->{border_width}) if exists $opts->{border_width};
$w->set_shadow_type(delete $opts->{shadow_type}) if exists $opts->{shadow_type};
$w->set_position(delete $opts->{position_policy}) if exists $opts->{position_policy};
@@ -413,22 +421,6 @@ sub _gtk__Window {
$w;
}
-sub _gtk__Dialog {
- my ($w, $opts) = @_;
-
- if (!$w) {
- $w = Gtk2::Dialog->new;
-
- $w->set_modal(delete $opts->{modal}) if exists $opts->{modal};
- $w->set_border_width(delete $opts->{border_width}) if exists $opts->{border_width};
- $w->set_transient_for(delete $opts->{transient_for}) if exists $opts->{transient_for};
- $w->set_position(delete $opts->{position_policy}) if exists $opts->{position_policy};
- }
- $w->set_title(delete $opts->{title}) if exists $opts->{title};
-
- $w;
-}
-
sub _gtk__FileSelection {
my ($w, $opts) = @_;