python - Why won't my Button widget expand vertically -


i familiarizing myself tkinter, , attempting write simple program, displays button in window, using pack geometry manager.

i experimenting various configuration options pack(), such expand, fill, , side, , i've run peculiar problem. have written following code:

from tkinter import *  root = tk() widget = button(root, text='text') widget.pack(expand=yes, fill=both) root.mainloop() 

the problem button expands fill window in horizontal direction, not vertical direction. same result if instead of specifying fill=both use fill=x. in addition, if specify instead fill=y button not expand in either direction. seems going wrong fill in vertical direction, , cannot figure out might be.

i attempted google problem , surprisingly found no mention of happening else. using mac os x yosemite , running python 2.7.5. attempted compile python 3.4.1 , saw no change.

edit:

based off of answer , comments below, clear there nothing wrong code, because seems work on other machines. if not error in code, know possibly causing button not stretch vertically when run above code?

this feature of native buttons on osx. buttons on osx fixed height , not expand vertically. there nothing can do, short of using different widget such label.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -