Ani wrote:
> Donald Arseneau wrote:
> > (I failed to post this properly at first.)
> >
> > "Ani" <anilby@gmail.com> writes:
> >
> > > canvas $base.top1.new_frame.canvas1 -width 30 -height 30 \
> > > -yscrollcommand [list $base.top1.new_frame.sc1 set]
> >
> > You don't set a scroll region or increment for the
> > canvas, and I suspect you intended
> >
> > canvas $base.top1.new_frame.canvas1 -height 30 \
> > -yscrollcommand [list $base.top1.new_frame.sc1 set] \
> > -scrollregion {0 -300 30 0} -yscrollincrement 10
> >
> > Why the negative y value? Because you anchor your frame "sw":
> >
> > > set fr1 [frame $base.top1.new_frame.canvas1.fr -relief raised \
> > > -borderwidth 10]
> > > $base.top1.new_frame.canvas1 create window 0 0 -anchor sw -window $fr1
> >
> > But let's be sensible, anchor nw, and measure the frame (after
> > you populate it with widgets)
> >
> > <grid widgets into fr1>
> > update idletasks
> >
> > $base.top1.new_frame.canvas1 create window 0 0 -anchor nw -window $fr1
> > $base.top1.new_frame.canvas1 configure -scrollregion [list 0 0 30 \
> > [winfo reqheight $fr1]]
> >
> >
> > --
> > Donald Arseneau asnd@triumf.ca
>
> Thanks for the reply Donald.
> This is what I coded, now I am not able to get the UI up at all
> ******************************************************************
>
> frame $base.frame#1 -bd 1 -relief groove
> canvas $base.frame#1.canvas -width 20 \
> -yscrollcommand [list $base.frame#1.sc1 set] \
> -scrollregion {0 -300 30 0} -yscrollincrement 10
> scrollbar $base.frame#1.sc1 -orient vertical \
> -command [list $base.frame#1.canvas yview]
> set fr1 [frame $base.frame#1.canvas.fr -relief raised \
> -borderwidth 10]
> .
> .
> .
> grid $base.frame#1 -in $root -row 13 -column 1 \
> -columnspan 20 \
> -rowspan 20 \
> -sticky nw
> grid $base.frame#1.canvas -in $$base.frame#1 -row 1 -column 1 \
> -sticky news
>
> grid $base.frame#1.sc1 -in $base.frame#1 \
> -sticky ns \
> -rowspan 7
> grid $fr1 -in $base.frame#1 \
> -columnspan 20 \
> -rowspan 20 \
> -sticky nw
> .
> .
> .
> # in one of the procedure where widgets are created
>
> frame $fr1.choicefr$name -bd 2
> label $fr1.choicefr$name.label$row1 \
> -anchor w \
> -justify left \
> -font $font \
> -text $valu41
> radiobutton $fr1.choicefr$name.rbt$row1 \
> -anchor w \
> -value $row1 \
> -variable rbutton1 \
> -relief flat
> label $fr1.choicefr$name.rbtlabel$row1 \
> -anchor w \
> -font $font \
> -justify left \
> -text $name
> .
> .
> .
> .
> # and at the last
> update idletasks
> .frame#1.canvas create window 0 0 -anchor nw -window $fr1
> .frame#1.canvas configure -scrollregion [list 0 0 30 \
> [winfo reqheight $fr1]]
>
> *************************************************************
>
> What could be the reason? I have removed the toplevel to have all teh
> widgets
> in frame#1.
Atlast I made it working.
Got the scrolled frame concept from
http://mini.net/tcl/AScrolledFrame
Received on Thu Sep 29 14:19:40 2005