in reply to Text widget on Photo (Tk)
Absolutely. Just use the place geometry manager instead of (or in addition to) pack.
For example:
use strict; use warnings; use Tk; my $GUI = new MainWindow; my $ROW1=$GUI->Frame(-relief=>'flat', -borderwidth=>0, -background=>'#c2d297') ->pack(-side=>'top', -fill=>'x'); my $photo = $ROW1->Photo(-file=>"numbers/1.bmp"); my $photo_canvas = $ROW1->Canvas(-width=>29, -height=>32, -background=>'#c2d297', -borderwidth=>0) ->pack(-side=>'left'); my $text = $ROW1->Text()->place(-x => 16, -y => 16); $photo_canvas->createImage(16, 18, -image=>$photo); MainLoop;
The above example overlays a Text widget on top of the photo, by overlapping it in Frame $ROW1, with (x,y) coordinates of (16, 16). Please refer to the Perl/Tk documentation, specifically the pages about geometry management (eg. pack, grid and place) for more details.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Text widget on Photo (Tk)
by antioch (Sexton) on Dec 12, 2006 at 23:47 UTC |