Help with Tk Packer

From: Loy D'Souza <lds_at_potomac.wash.inmet.com>
Date: Fri, 18 Nov 1994 15:32:59 -0500 (EST)

Hi!

I want to pack a label and a Text widget such that the width of the
text widget is dictated by the label (of type text). But the whatever
i do text widget seems to dictate its width to the label.

Here's the actual code ...

There are 3 frames f1 f2 and f3. Each contains a label and a text widget.
The width of the text widget is not specified and is supposed to be dictated
by the label widget. The label widget in turn expands to whatever its master
frame 'f' gives. In my particular eg. the master 'f' has width a lot more
than any of the labels and without the text widgets all the 3 labels get
eual width. But with the text widgets, the first text 'text1' widget gets
'greedy' and takes up the entire horizontal space available in 'f'.

--
    (frame '.statement.st.f.f1 )
    (frame '.statement.st.f.f2 )
    (frame '.statement.st.f.f3 )
    (pack '.statement.st.f.f1 '.statement.st.f.f2
	  '.statement.st.f.f3 :side "left" :fill "both" :expand #t)
    (label '.statement.st.f.f1.title1 :text "data"
	   :relief "ridge" :padX "2" :padY "2")
    (label '.statement.st.f.f2.title2 :text "clk"
	   :relief "ridge" :padX "2" :padY "2")
    (label '.statement.st.f.f3.title3 :text "time"
	   :relief "ridge" :padX "2" :padY "2")
    (pack '.statement.st.f.f1.title1 '.statement.st.f.f2.title2 
	  '.statement.st.f.f3.title3 :side "top" :fill "both" :expand #t)
      
    (text '.statement.st.f.f1.text1 :height "1" :relief "ridge"
	  :state state :bd "2" 
	  :padx "2" :pady "2")
    (text '.statement.st.f.f2.text2 :height "1" :relief "ridge"
	  :state state :bd "2" 
	  :padx "2" :pady "2")
    (text '.statement.st.f.f3.text3 :height "1" :relief "ridge"
	  :state state :bd "2" 
	  :padx "2" :pady "2")
    (pack '.statement.st.f.f1.text1   
	  :side "bottom" :after '.statement.st.f.f1.title1)
    (pack '.statement.st.f.f2.text2 
	  :side "bottom" :after '.statement.st.f.f2.title2)
    (pack '.statement.st.f.f3.text3  
	  :side "bottom" :after '.statement.st.f.f3.title3)
    
--
Thanks
Loy
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
				Loy M. D'Souza
Intermetrics, Inc.				      Email: lds_at_wash.inmet.com
7918 Jones Branch Drive, #710			      Phone: (703) 827 2606
McLean, VA 22102				      Fax:   (703) 827 5560
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Received on Fri Nov 18 1994 - 21:33:48 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST