[Tkinter-discuss] Need help with a text + scrollbar widget and expansion

Michael Lange klappnase at web.de
Tue Mar 21 12:18:34 CET 2006


On Mon, 20 Mar 2006 12:10:41 -0600
Mannequin* <mannslists at invigorated.org> wrote:

> Now, if you run this, you'll notice that when you expand the window 
> horizontally ( <---> ) that the text + scrollbar widget doesn't expand 
> with the window.
> 

> self.bible_scroll.pack (side = RIGHT, fill = Y, expand = "yes", anchor = W)

Remove the expand='yes' from the line above.

> 
> By the way, is there anyway to enhance the look of the Tkinter widgets 
> under Linux using what comes standard with Python. I'm trying to stay as 
> standard as I possibly can.
> 

You can change some of Tk's "ugly" defaults in an option database, that may look something like this:

*font : Helvetica -12
*Entry*background : white
*Listbox*background : white
*Listbox*exportSelection : 0
*selectBackground : blue4
*selectForeground : white
*Scrollbar*takeFocus : 0
*Scrollbar*highlightThickness : 0
*Menu*tearOff : 0

etc.

If you store this in a file "optionDB" you can apply the new defaults with:

root = Tk()
root.option_readfile(<path-to-optionDB>)

I hope this helps

Michael





More information about the Tkinter-discuss mailing list