The following issue disturbs me: I'm using overrideredirect to remove decorations and as a result the widget is always on top. This is usually fine, but sometimes I want to have a popup on top of the MW, but overrideredirect seems to always win. Is there anyway to make a window on top of an overrideredirect window? I've extended a famous example to emphasize the issue
#!/usr/bin/perl -w use strict; use Tk; my $mw = tkinit; my $notification = $mw->Toplevel(); $notification->geometry('+400+400'); $notification->overrideredirect(1); # Remove window decorations $notification->withdraw; # Hide display window $notification->Label( -text => 'Your message displayed here.', -foreground => 'white', -background => 'black', -height => 5 )->pack; $notification->Button( -text => 'Press Me', -command => sub {my $msg = $mw->messageBox(-icon => 'error', -message => "No tests selected", -title => 'Error', -type => 'Ok', -default => 'Ok'); } )->pack; $mw->Button( -text => 'Display Notification Window', -command => \&display_note )->pack; MainLoop; sub display_note { $notification->deiconify; $notification->raise; # this is where you setup a condition to withdraw it $notification->after( 5000, \&hide_note ); } sub hide_note { $notification->withdraw; }
In reply to Prevent overidedirect from being always on top by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |