Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Keep up the very good job that you and your team are doing. This site has replaced my morning cup of tea as a must have/do!!!..."

Geography

Where in the world do Tek-Tips members come from?

Noob question about buttons

clavelli (Programmer)
14 Jul 12 3:47
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!
Bong (Programmer)
16 Jul 12 10:05
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

Bong (Programmer)
16 Jul 12 10:07
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

clavelli (Programmer)
16 Jul 12 14:18
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.

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!

Back To Forum

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