in reply to Placement of image with Tk::Compound and Tk::Menu
Telling you to go look at the Tk::Image module to create the image.-image => value Specifies an image to display in the menu instead of a text string + or bitmap The image must have been created by some previous invocati +on of image create. This option overrides the -label and -bitmap opti +ons but may be reset to an empty string to enable a textual or bitmap + label to be displayed. This option is not available for separator or + tear-off entries.
If you want to use the 'images' from the Tk::Toolbar I think you will have to use the -bitmap option on the menu item rather than -image.
In addition, you have not used a geometry manager on your widgets in the code you showed us, so you wouldn't see anything anyway! Even the very simple example in Tk::Compound will give you some clues:
my $b = $parent->Button; my $c = $b->Compound; $b->configure(-image => $c); $c->Line; $c->Bitmap(-bitmap => 'warning'); $c->Space(-width => 8); $c->Text(-text => "Warning", -underline => 0); $b->pack;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Placement of image with Tk::Compound and Tk::Menu
by Anonymous Monk on Jul 05, 2006 at 03:35 UTC | |
by jdtoronto (Prior) on Jul 05, 2006 at 03:46 UTC | |
by ldln (Pilgrim) on Jul 05, 2006 at 03:57 UTC | |
by jdtoronto (Prior) on Jul 05, 2006 at 05:57 UTC | |
by ldln (Pilgrim) on Jul 05, 2006 at 09:57 UTC |