Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placing buttons inside a canvas GIF image

Status
Not open for further replies.

mucklow

Programmer
May 22, 2001
40
US
Hello, I'm using Tcl\TK 8.4 on Windows and I'm trying to create a GUI with buttons, pulldowns, etc... but what I want to do is have my GIF logo as the entire background and have the buttons placed inside the logo. I've tried several variations but can't seem to get the buttons to pack inside the GIF, only outside. Any suggestions?

Here is my code:

wm withdraw .
set w .icon
catch {destroy $w}
toplevel $w
wm title $w "Menu"
wm iconname $w "icon"

image create photo img -format GIF -file C:\\my_logo.gif
canvas $w.image -width 650 -height 300
$w.image create image 325 185 -image img
pack $w.image -side top

frame $w.buttons
pack $w.buttons -side bottom -fill x -pady 2m
button $w.buttons.dismiss -text " Exit " -command exit
pack $w.buttons.dismiss -side bottom -expand 1

button $w.b1 -text "Option 1" -width 10 \
-command {exec my_command1_here}
button $w.b2 -text "Option 2" -width 10 \
-command {exec my_command2_here}
button $w.b3 -text "Option 3" -width 10 \
-command {exec my_command3_here}
button $w.b4 -text "Option 4" -width 10 \
-command {exec my_command4_here}

pack $w.b1 -side left -expand yes -pady 2
pack $w.b2 -side left -expand yes -pady 2
pack $w.b3 -side left -expand yes -pady 2
pack $w.b4 -side left -expand yes -pady 2
 
Take a look at the place geometry manager. I've never tried to do this but, obviously, pack is doing it's voodoo on you.

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top