Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Noob question about buttons

Noob question about buttons

Noob question about buttons

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!

RE: Noob question about buttons

I do it (with pack) using "configure" on the widget, not the geometry:

CODE -->

% button .exit -text "Exit" -command exit
() 2 % pack .exit
() 3 % .exit configure -width 12
() 4 % .exit configure -width 10
() 5 % .exit configure -height 12
() 6 % 

Bob Rashkin

RE: Noob question about buttons

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

RE: Noob question about buttons

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close