Hi, I am a tk beginner, any help will be greatly apprecitated.
My problem is I have a frame which contain a canvas inside,
if I resize frame, the canvas did not resize to fill the
frame. How can I make canvas resize whenever the frame resize?
Thanks.
frame .f
canvas .f.c -width 200 -height 100 -bg beige -yscrollcommand {.f.vs set} -xscrollcommand {.f.hs set}
scrollbar .f.vs -command {.f.c yview}
scrollbar .f.hs -orient horizontal -command {.f.c xview}
grid .f.c .f.vs -sticky ns
grid .f.hs -sticky ew
pack .f
#.f.c create text 0 0 -anchor nw -text (0,0)
#.f.c create text 300 200 -anchor se -text (300,200)
set img [image create photo -file logo.gif]
.f.c create image 10 10 -anchor nw -image $img
.f.c config -scrollregion [.f.c bbox all]
My problem is I have a frame which contain a canvas inside,
if I resize frame, the canvas did not resize to fill the
frame. How can I make canvas resize whenever the frame resize?
Thanks.
frame .f
canvas .f.c -width 200 -height 100 -bg beige -yscrollcommand {.f.vs set} -xscrollcommand {.f.hs set}
scrollbar .f.vs -command {.f.c yview}
scrollbar .f.hs -orient horizontal -command {.f.c xview}
grid .f.c .f.vs -sticky ns
grid .f.hs -sticky ew
pack .f
#.f.c create text 0 0 -anchor nw -text (0,0)
#.f.c create text 300 200 -anchor se -text (300,200)
set img [image create photo -file logo.gif]
.f.c create image 10 10 -anchor nw -image $img
.f.c config -scrollregion [.f.c bbox all]