That is clever, but is it needed?

as far as I can tell, it isn't needed, as the messagebox pops up on top of the notification no matter what happens

#!/usr/bin/perl -- use strict; use warnings; use Tk; Main( @ARGV ); exit( 0 ); sub Main { my $mw = tkinit( ); $mw->geometry('+300+400'); my $notification = $mw->Toplevel( ); $notification->geometry('+400+400'); $notification->overrideredirect(1); # Remove window decorations $notification->withdraw; # Hide display window $notification->Label( -text => 'keep clicking toggle ', -foreground => 'white', -background => 'black', -height => 5 )->pack; $notification->Button( -text => 'Press Me', #~ -command => [ \&important_message, $notification ], ## not +needed -command => \&important_message, )->pack; $mw->Button( -text => 'Display Notification Window', -command => [ 'deiconify', $notification ], )->pack->focus; $mw->Button( -text => 'toggle topmost notification ', -command => [ \&toggle_topmost , $notification ], )->pack; $mw->Button( -text => 'hide notification ', -command => [ 'withdraw', $notification ], )->pack; ## $mw->WidgetDump; ## debugging aid MainLoop; } sub important_message { #~ my( $n ) = @_; my( $n ) = $Tk::widget; #~ my $msg = $mw->messageBox( ## works to raise above $notificatio +n on win32, might not work on all platforms my $msg = $n->messageBox( -icon => 'error', -message => "No tests selected", -title => 'Error', -type => 'Ok', -default => 'Ok', ); } sub toggle_topmost { my( $n ) = @_; warn $n->attributes; $n->attributes(-topmost => ! $n->attributes(-topmost ) );; $n->parent->raise; $n->parent->focus; } __END__ __END__

In reply to Re^2: Prevent overidedirect from being always on top by Anonymous Monk
in thread Prevent overidedirect from being always on top by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.