From: <no...@so...> - 2001-12-18 10:58:12
|
Bugs item #220865, was opened at 2000-10-31 17:32 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112997&aid=220865&group_id=12997 Category: 63. Generic Window Operations Group: = 8.2 Status: Open Resolution: None Priority: 5 Submitted By: Brent B. Welch (welch) Assigned to: Nobody/Anonymous (nobody) Summary: Windows/Unix discrepancy, Toplevel -width/-height/-menu Initial Comment: OriginalBugID: 2722 Bug Version: 8.2 SubmitDate: '1999-09-10' LastModified: '2000-01-17' Severity: MED Status: UnAssn Submitter: techsupp ChangedBy: hobbs RelatedBugIDs: 3185 OS: Windows 95 Machine: X86 Name: Hume Smith ReproducibleScript: toplevel .x -menu .x.menuBar -width 400 -height 300 menu .x.menuBar toplevel .y -width 400 -height 300 ObservedBehavior: On unix, the windows are the same size* On Windows'95, .x shrinks to the size of the menubar (* I hope - I haven't tried this exact code. It's really Quill's windows that behave differently, and it appears to be the -menu option that causes the difference.) DesiredBehavior: I expect the same behaviour on '95 and X... I want both windows the same size, as on X ---------------------------------------------------------------------- Comment By: Vince Darley (vincentdarley) Date: 2001-12-18 02:58 Message: Logged In: YES user_id=32170 Here's another example, with a workaround: menu .menubar wm title . "Alphatk" . configure -menu .menubar menu .menubar.help -tearoff 0 .menubar add cascade -menu .menubar.help -label "Help" # This looks rather confused. The idea is to generate a long thin # window across the top of the screen, containing the Tk menu # bar. However some unix systems include the height of the menu # bar in '.', so settings its height to 0 is very bad... we don't # get any menus! Also we somehow need a bunch of updates etc, so # that this works on different versions of WinTk (there have been # a number of behavioural changes in the wm code of 8.2.x-8.3.x). # # Anyway, I think it works for all platforms now! wm geometry . +0+0 frame .dummy -height 0 -width [winfo screenwidth .] pack .dummy update wm geometry . +0+0 update destroy .dummy We had to use a dummy frame to get the same desired behaviour on unix and windows. Surely this code should be as simple as: menu .menubar . configure -menu .menubar wm geometry . [winfo screenwidth .]x[winfo reqheight .] +0+0 But that won't work properly on all platforms (any platforms?). Even worse, if we repeat these two lines: % .menubar add cascade -label foo % wm geometry . [winfo screenwidth .]x[winfo reqheight .menubar]+0+0 over and over, the height of the '.' window grows each time! I guess this means that 'winfo reqheight .menubar' is the wrong thing to use. Anyway, some consistency needs to be applied to menubar geometry handling across the various platforms. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112997&aid=220865&group_id=12997 |