in reply to Re^3: 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

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
  • Comment on Re^4: How to Populate multiple Solaris gnome windows with a Perl/TK widget

Replies are listed 'Best First'.
Re^5: How to Populate multiple Solaris gnome windows with a Perl/TK widget
by zentara (Cardinal) on Jun 03, 2005 at 18:24 UTC
    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