Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Noob question about buttons

Status
Not open for further replies.

clavelli

Programmer
Jul 14, 2012
2
US
Sorry to ask such a simple question, but I seem to be unable to change the height of any buttons, whether I am using grid, pack or place. I am going through a book, and even when a copy the code in the book, the height won't change. The book is from 1998, so it's possible that that is the issue. Anyway...
Here is a short sample using place:

button .exit -text "Exit" -command exit
place .exit -relx 0.5 -rely 0.5 -anchor c -relwidth 0.8 -relheight 0.8

And it comes out with a button that stretches through most of the window in the x direction, but has normal height in the y direction. Same issue in pack and grid.

Thank you all!
 
I do it (with pack) using "configure" on the widget, not the geometry:
Code:
% button .exit -text "Exit" -command exit
.exit
() 2 % pack .exit
() 3 % .exit configure -width 12
() 4 % .exit configure -width 10
() 5 % .exit configure -height 12
() 6 %

_________________
Bob Rashkin
 
Actually, I meant to say, "using pack in this example". Obviously, the geometry manager doesn't matter since I'm configuring the widget, itself.

_________________
Bob Rashkin
 
I did that, and it didn't work. could it be because I am using a Mac? Everything works fine on my other Windows computer, but I don't know what's up here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top