Re: Parse input file and create widgets
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Parse input file and create widgets

From: Donald Arseneau <asnd@triumf.ca>
Date: Mon May 30 2005 - 12:35:11 CEST

(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
Received on Thu Sep 29 14:19:39 2005