in reply to Re: How to Populate multiple Solaris gnome windows with a Perl/TK widget
in thread How to Populate multiple Solaris gnome windows with a Perl/TK widget

Thanks for the reply. To clarify things..When I logon to the solaris box, there are 6 gnome workspaces that appear in the botttom right of the screen that I can select from. I would like my Perl Gui to appear in all 6 of the workspaces, so that whenever the user switches from one workspace to the next the Perl Gui widget will allways appear ontop of the workstpace window. I hope this clarifies things. thanks w3ntp
  • Comment on Re^2: How to Populate multiple Solaris gnome windows with a Perl/TK widget

Replies are listed 'Best First'.
Re^3: How to Populate multiple Solaris gnome windows with a Perl/TK widget
by zentara (Cardinal) on Jun 03, 2005 at 12:17 UTC
    It sounds like you just want to add the overrideredirect flag to your script. This code should stay on top of all 6 workspaces.
    #!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; $mw->geometry("200x300+200+200"); $mw->overrideredirect(1); # set the override-redirect flag $mw->packPropagate(0); # prevent the window being resized # for this demo $mw->Button( -text => 'Quit', -command => sub { Tk::exit(0) }, )->pack( -side => 'bottom', ); MainLoop;

    I'm not really a human, but I play one on earth. flash japh
      Hi, The "overrideredicect(1)" command worked. My Widget box populated all 6 window Workspaces. The only drawback was that it removed the boarder around my Widget box so that I could not minimize or maximize the widget. Any ideas of how to populate all the Workspaces and have the minimize and maximize buttons on the top of the widget? thanks w3ntp
        It gets a little tricky with Tk. It only has the overrideredirect method to stay on top across workspaces. You can make little custom buttons, up in the corners to do it manually. For example( you can extend it to resize):
        #!/usr/bin/perl use warnings; use strict; use Tk; my $top = MainWindow->new; $top->geometry('200x200+200+200'); $top->overrideredirect(1); $top->Label( -text => 'Click and Drag' )->pack( -expand => 1, -fill => 'both' ); $top->Button( -text => 'Exit', -command => sub { $top->destroy } )->pack; my @deltaxy; $top->bind( '<1>' => \&getdelta ); $top->bind( '<B1-Motion>' => \&mousemove ); MainLoop; sub mousemove { my ( $width, $height, $x, $y ) = split /[+x]/, $top->geometry; $x = $top->pointerx - $deltaxy[0]; $y = $top->pointery - $deltaxy[1]; $top->geometry( $width . 'x' . $height . "+$x+$y" ); } sub getdelta { @deltaxy = ( $top->pointerx - $top->x, $top->pointery - $top->y ); }

        Or, you can temporarily turn off overrideredirect, resize, and then turn it back on. But while it is turned off, it will only be visible on the current desktop. So you will have to work out some scheme to turn off, resize, and immediately turn it back on again. Here is just a simple "turn off".

        #!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; $mw->geometry("200x300+200+200"); $mw->overrideredirect(1); # set the override-redirect flag $mw->Button( -text => 'Quit', -command => sub { Tk::exit(0) }, )->pack( -side => 'bottom',); $mw->Button( -text => 'Restore WM Controls', -command => \&restore_WM, )->pack( -side => 'bottom',); MainLoop; sub restore_WM{ $mw->withdraw; $mw->overrideredirect(0); # set the override-redirect flag $mw->update; $mw->deiconify; }

        I'm not really a human, but I play one on earth. flash japh