in reply to Unable to completely destroy a Dialog in Perl Tk

Dear Elders, this dialog misbehaves, does not listen to me, what should I do?

Read Coping with Scoping, How do I post a question effectively?, and start posting code that compiles, code like

#!/usr/bin/perl -- use Tk; use Tk::Dialog; my $mw = tkinit; my $snot = "snot"; $mw->Label( -textvariable => \$snot )->pack;; $mw->Button( -text => 'wipe', -command => sub { my $d = $mw->Dialog( -title => "Title", -text => "Text", -buttons => [ "OK", "Cancel" ] ); $d->geometry('200x200+40+40'); $snot .= '('. $d->Show . ")\n"; $d->destroy(); undef $d; }, )->pack; MainLoop; __END__

Replies are listed 'Best First'.
Re^2: Unable to completely destroy a Dialog in Perl Tk
by pashanoid (Scribe) on Aug 11, 2011 at 08:21 UTC
    Thank you for going to all this trouble of posting a real 'live' example of a dialog box. This is a trivial example. Mine is more complicated because the internals of my program call out for a creation of a dialog box based on some event inside the program. Then when this event is gone (process killed, message recieve, etc) the dialog box should just dissapear on its own... is this possible? I don't want the user to press OK or CANCEL or anything... Just want the DIALOG gone. If not possible I will not use dialogs at all. Thank you!