Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: perl/tk messagebox

by clintp (Curate)
on Dec 18, 2001 at 00:07 UTC ( [id://132646]=note: print w/replies, xml ) Need Help??

in reply to perl/tk messagebox

Do you mean like a popup dialog box ("Please reboot now. OK/Cancel") or do you mean like a mouseover message? The former can be done easily with Tk::Dialog.


use Tk::Dialog; [....] $d=$mw->Dialog(-title => "reboot", -text => "Please reboot now?", -buttons => [ qw/ Yes Cancel / ]); if ($d->Show eq "Yes") { halt(); }

Replies are listed 'Best First'.
Re: Re: perl/tk messagebox
by dhable (Monk) on Dec 18, 2001 at 20:25 UTC
    Dialog will work if you only want to display a text message. If you are looking for a replacement for the VB MsgBox command , you need to use DialogBox.
    use Tk::DialogBox; use Tk::JPEG; [.....] $d = $mw->DialogBox( -title => "reboot", -buttons => [ qw/Yes Cancel/] +); $mw->Photo( "redx", -format => "JPEG", -file => "redx.jpg"); $d->add( Label, image => "redx"); $d->add( Label, -text => "Please reboot now?"); if( $d->Show eq "Yes") { halt(); }
Re: perl/tk messagebox
by ff (Hermit) on Oct 14, 2002 at 19:13 UTC
    And for a truly simple example, in which all you want to do is display a message (and a little "OK" box comes up by default to let you flush the message when you are finished reading it), the above can be narrowed down to:
    $d=$tl->Dialog(-title => "A Message", -text => "This is my message."); $d->Show;

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://132646]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-14 07:16 GMT
Find Nodes?
    Voting Booth?

    No recent polls found