You can always use the all-powerful overrideredirect(1). It's only drawback is your on-top window will be on top on every virtual desktop. The following script uses just about every trick. :-) It shouldn't leak memory with constant use.
#!/usr/bin/perl use Tk; my $mw= MainWindow->new(); ################################################################## my $dialogdel = $mw->Toplevel(-bg=>'steelblue'); #my $dialogdel = MainWindow->new(-bg=>'steelblue'); $dialogdel->overrideredirect(1); $dialogdel->geometry('200x100+600+100'); $dialogdel->configure(-cursor => 'top_left_arrow'); $dialogdel->Label(-text=>"Ready to delete $key_sel", -bg=>'pink', -fg=>'black', -width=>20)->pack(-side=>'top',-fill=>'x'); my $dlabel = $dialogdel->Label(-text=>"Confirm delete $key_sel?", -bg=>'yellow', )->pack(-side=>'top'); $dialogdel->Button( -text => 'Delete', -bg=>'yellow', -activebackground=>'orange', -command => sub{print chr(07) })->pack; $dialogdel->Button( -text => 'Cancel', -bg=>'red', -activebackground=>'plum', -command => sub{$dialogdel->grabRelease; $dialogdel->withdraw; } )->pack(-side=>'right',-anchor=>'e'); $dialogdel->withdraw; ###################################################################### +#3 $mw->Button( -text => 'Delete', -bg=>'yellow', -activebackground=>'orange', -command => \&delete_key)->pack; MainLoop; sub delete_key{ $dialogdel->deiconify; $dialogdel->focus; $dialogdel->grab; }

I'm not really a human, but I play one on earth. ..... an animated JAPH

In reply to Re: Tk keep Toplevelwindow on top of its Mainwindow by zentara
in thread Tk keep Toplevelwindow on top of its Mainwindow 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.