How to precisely set text widget size?
Dear STkers:
I'm having a problem with text widget sizing. I can't seem to make a
text widget of a specific size (in pixels). Setting the height and
width only affect the size in whole numbers of lines & columns (resp).
I don't think this is a problem when a text widget is packed inside a
frame which is managed by the packer, for example. In this case, the
text widget expands up to its stated height and width, but will be
constrained by the size of the frame, which in turn can be constrained
by the packer.
The problem comes up when I try to insert a text widget inside a text
widget. For example:
(require "Tk-classes")
(define t (make <text>))
(pack t)
(define t2 (make <text>))
((id t) 'window 'create "end" :window t2)
(define img (image 'create 'photo :file "wmpanel.gif"))
(define l (make <label> :image img))
((id t2) 'window 'create "end" :window l)
What I'd like after doing this is to force text widget t2 to be
exactly the size of label l.
I've even tried inserting a frame into t instead of a text widget, and
packing t2 into the frame, and setting the height and width of the
frame. This still doesn't work.
Presumably, the geometry management of text widgets is somewhat loose.
It allows inserted windows to grow to whatever size they desire.
Thus, it doesn't seem like anything inserted into a text widget can
have a constrained size. Is this really correct? Does anyone have
any way around this?
Thanks,
Harvey J. Stein
hjstein_at_math.huji.ac.il
Received on Sat Nov 04 1995 - 19:48:21 CET
This archive was generated by hypermail 2.3.0
: Mon Jul 21 2014 - 19:38:59 CEST