Tk Source Code

View Ticket
Login
Ticket UUID: 673722
Title: Button width computation in standard dialogs
Type: Bug Version: obsolete: 8.4.1
Submitter: jenglish Created on: 2003-01-24 00:49:01
Subsystem: 33. Generic Dialog Support Assigned To: dkf
Priority: 4 Severity:
Status: Closed Last Modified: 2003-02-21 21:50:48
Resolution: Fixed Closed By: dkf
    Closed on: 2003-02-21 14:50:48
Description:
The standard dialogs (tk_get*File, etc.) only pay
attention to the button -text when computing the
maximum button widths.   If buttons are also given an
-image (say via the option database), the layout is
miscomputed.

For example:
----
# Quick-and-dirty "theme" support: (Requires Tk 8.4+)
image create photo check -data
{R0lGODlhEAAQAIIAAPwCBMT+xATCBASCBARCBAQCBEQCBAAA
ACH5BAEAAAAALAAAAAAQABAAAAM2CLrc/itAF8RkdVyVye4FpzUgJwijORCGUhDDOZbLG6Nd2xjwibIQ
2y80sRGIl4IBuWk6Af4EACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERl
dmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3Iu
Y29tADs=}

option add *ok.image check
option add *ok.compound left

pack [button .ok -text OK];# This does the Right Thing
tk_getOpenFile;# [Open] button is too small!
---
User Comments: dkf added on 2003-02-21 21:50:48:
Logged In: YES 
user_id=79902

OK, everything should use [grid] instead of -width/[pack] now, 
which should enable this sort of theming.  I'm still *very* 
interested in having those sorts of images in the "default 
look" but that's lower priority.

dkf added on 2003-02-21 21:25:30:
Logged In: YES 
user_id=79902

Bah!  Still got the *other* dialogs to do...  <:^/

dkf added on 2003-02-21 21:23:33:
Logged In: YES 
user_id=79902

The file dialogs now use [grid] for at least part of their layout.  
Should we be considering adding graphics to the OK and 
Cancel buttons throughout for the "Tk" look?

dkf added on 2003-02-21 20:49:33:
Logged In: YES 
user_id=79902

Yuck.  The file dialogs use -width and [pack] to do their 
button layout...