Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Missing TK Messagebox icons

by radiantmatrix (Parson)
on Nov 15, 2007 at 17:12 UTC ( [id://651024]=note: print w/replies, xml ) Need Help??


in reply to Missing TK Messagebox icons

I'm not familiar with messageBox, but many similar Tk widgets will take any Image as a valid parameter to -icon.

So, something like:

my $msg_icon = $MW->Photo( -file=>'msgicon.xpm' ); $MW->messageBox( -message => $message, -icon => $msg_icon, -type => 'okcancel', -title => $title );

Ought to work. See Tk::Photo, which is an Image widget.

<radiant.matrix>
Ramblings and references
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet

Replies are listed 'Best First'.
Re^2: Missing TK Messagebox icons
by zentara (Archbishop) on Nov 15, 2007 at 18:37 UTC
    Ought to work

    Don't confuse the icon shown when a window is minimized, with an icon meant for informational display. If you read perldoc Tk::messageBox, it says it needs a Tk bitmap. Perldoc Tk::Bitmap specifies

    -data => string Specifies the contents of the source bitmap as a string. The string must adhere to X11 bitmap format (e.g., as generated by th +e bitmap program). If both the -data and -file options are specified,the -data option takes precedence. -file => name name gives the name of a file whose contents define the source bi +t map. The file must adhere to X11 bitmap format (e.g., as gener +ated by the bitmap program).
    So all Tk::Photo objects will not work.

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found