Hi all,

I am in the process of writing a program which alerts the user when a Mail is received by an IMAP server. I alert the user by displaying a Dialog box.

But what happens is, the program is getting blocked until, the user presses the ok buttoon

But I want to continue my program, even if the user didn't give input. I searched in perlmonks and I got posts regarding to use the splash screen

I've tried the following sample program

#!/usr/bin/perl -w use strict; use Tk; my $mw = tkinit; $mw->withdraw(); my $i=0; my $k=0; while (1) { my $notification = $mw->Toplevel(); $notification->geometry("+$i+$k"); $i+=10; $k+=5; $notification->protocol('WM_DELETE_WINDOW' => sub { $notificat +ion->withdraw; }); $notification->Label( -text => 'Your message displayed here.', -height => 5 )->pack; $notification->withdraw; $notification->deiconify; $notification->raise; $notification->update(); $mw->after(5000); }

The code works. It display a new window in the given geomentry

Now If I click the close button in any one of the splash screen, I want to close only that splash screen

Can someone suggest how to do that??

I also wanted to know, is there any ways to make the dialog box to non-blocking??

--Lakshmanan G.

The great pleasure in my life is doing what people say you cannot do.



In reply to Non blocking a Dialog box in Perl Tk by lakshmananindia

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.