Re: How to increase buffer for text widget
- From: Bezoar <cwjolly@xxxxxxxxx>
- Date: Tue, 29 Jul 2008 16:06:51 -0700 (PDT)
On Jul 29, 4:52 pm, lawsonre...@xxxxxxxxx wrote:
When loading text into my text widget, the GUI only displays 9 lines
of text. I believe I need to increase the buffer size for the text
widget.
How would I do this?
Thanks.
The buffer is already larger than 9 lines. You can do one of two
things or both. Pack the text widget so that it expands ( but you will
be limited to the number of rows that will fit on your screen) or you
will need to add scrollbars to get to view the remainder of the data.
An example cut from some code. This creates a text widget 80 columns
wide ( by default lines are wrapped) and 30 lines high but
the packing options are such that you can resize to any size and the
text widget will adjust.
package require Tk
proc makeExample { {root . } } {
set root [string trimright .$root "." ]
frame $root.topframe -relief groove
set t [text $root.topframe.text -width 80 -height 30 -
yscrollcommand { $root.topframe.sy set} ]
scrollbar $root.topframe.sy -command [list $t yview]
pack $t -side left -expand 1 -fill both
pack $root.topframe.sy -side left -expand 0 -fill y
pack $root.topframe -side top -expand 1 -fill both
return $t
}
set txtwidget [makeExample . ]
for { set i 0 } { $i < 100 } { incr i } {
$txtwidget insert end [string repeat $i 30 ]\n
}
HTH
Carl
.
- References:
- How to increase buffer for text widget
- From: lawsonready
- How to increase buffer for text widget
- Prev by Date: How to increase buffer for text widget
- Next by Date: spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?
- Previous by thread: How to increase buffer for text widget
- Next by thread: spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?
- Index(es):
Relevant Pages
|