Quoting [EMAIL PROTECTED]:

> [pygtk-0.7.0, python-1.6a2, gtk-1.2.7, Suse Linux 6.1, kernel 2.2.11]
> 
> I create a gtktext widget and insert a few lines of text, then show().
> Why doesn't the widget shrink to fit the text it contains?

Because that would give you a GUI that would "flicker". Normally, GUIs
should resize themselves only once because our eyes are genetically
built to focus on movement (our hunter heritage). Therefore, any
movement on the screen (e.g. the famous animated GIF ads) will drain
from your concentration and that's why GUIs should be static (similar
when the app does something which takes very long: Then it should
display a dynamic GUI to make the user feel that the time is going
by much faster than it actually is).

Conclusion: Trying to make the text widget resize while you type is
a bad idea. Instead, you should "empower" your users and make the widget
grow and shrink when the user resizes the window and you should remember
the last window size so the user gets the same size again when he
starts your app next time.

As for "giving the text widget an initial large/smaller size than the
default", you must put the GtkText into a GtkScrolledWindow and give
that the size you want. Unfortunately, I know no simple way to calculate
the size of the window based on the font used in the GtkText.

-- 
==============================================
Sowatec AG,       CH-8330 Pf�ffikon (ZH)
Witzbergstr. 7,   http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, [EMAIL PROTECTED]
==============================================


-------------------------------------------------
This mail sent through IMP: www.hepe.com

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to