aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/MTools.pm22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/MTools.pm b/src/MTools.pm
index fb7ff74..f4c7a67 100644
--- a/src/MTools.pm
+++ b/src/MTools.pm
@@ -111,13 +111,15 @@ our %fonts;
my %gradients;
sub new {
- my ($class, $width, $height, $title) = @_;
+ my ($class, $width, $height, $title, $Zinc, $screen, $geometry) = @_;
my $self = {};
bless $self, $class;
-
- $self -> {window} = my $mw = MainWindow -> new ();
+ if (!defined $Zinc)
+ {
+ $screen = ":0.0" if (!defined $screen);
+ $self -> {window} = my $mw = MainWindow -> new ('-screen' =>$screen);
$mw -> title($title);
-
+ $mw->geometry ($geometry) if (defined $geometry);
$self -> {zinc} = $zinc = $mw -> Zinc (
-width => $width,
-height => $height,
@@ -125,7 +127,13 @@ sub new {
-backcolor => 'white',
-render => 1,
) -> pack (qw/-expand yes -fill both/);
-
+ }
+ else
+ {
+ $self -> {zinc} = $zinc;
+ $zinc = $Zinc;
+ $self -> {window} = $zinc->toplevel ;
+ }
return $self;
}
@@ -489,8 +497,8 @@ sub raise {
}
sub chggroup {
- my ($obj, $parent) = @_;
- $zinc -> chggroup (ref ($obj) eq '' ? $obj : $obj -> {instance}, ref ($parent) eq '' ? $parent : $parent -> {instance});
+ my ($obj, $parent, $adjust) = @_;
+ $zinc -> chggroup (ref ($obj) eq '' ? $obj : $obj -> {instance}, ref ($parent) eq '' ? $parent : $parent -> {instance},$adjust);
}
sub clone {