| Ticket UUID: | 2239034 | |||
| Title: | [wm manage] failure with ttk::frames | |||
| Type: | Bug | Version: | None | |
| Submitter: | talvo | Created on: | 2008-11-08 04:19:49 | |
| Subsystem: | 68. Win Window Operations | Assigned To: | patthoyts | |
| Priority: | 8 | Severity: | ||
| Status: | Closed | Last Modified: | 2008-11-15 07:37:52 | |
| Resolution: | Fixed | Closed By: | patthoyts | |
| Closed on: | 2008-11-15 00:37:52 | |||
| Description: |
[wm manage] seems not to work with [ttk::frame]s. (It doesn't seem to be working right for other widgets, actually - see below.) Tk [frame]s work fine. I'm using TclKit 8.5.2 on Windows XP SP3. Example: % ttk::frame .f .f % button .f.b -text "Test" .f.b % pack .f.b % wm manage .f At this point, nothing noticable has happened - there isn't a new toplevel window created for .f If I then do % wm forget .f % pack .f I see my "Test" button appear in the absolute top left-hand corner of my screen (not in a window - floating loose). If I attempt to interact with it it vanishes instantly. It seems that space is allocated for the frame in . when I try to [pack] it, though - repeat the above with a [text] widget instead of a [button] and you'll see . grow to accomodate it, even though it doesn't actually pack it. (This isn't specific to [pack], either - I first noticed it in a panewindow) If I try [wm manage] with other Tk widgets (I've tried [button] and [text]), I still don't get a toplevel, but if I [wm forget $tkWidget] and then [pack $tkWidget], it does pack correctly. Other Ttk widgets seem to have the same issue as a ttk::frame. So, it seems like only [frame]s can be successfully [wm manage]'d. (I actually remember reading it that way when I first heard about [wm manage] being added, but it seems not to be what the documentation at http://www.tcl.tk/man/tcl8.5/TkCmd/wm.htm#M39 says, so not sure whether this is a code error or a documentation fault. Though if it is only meant to work for frames, it should probably error for other widgets?) | |||
| User Comments: |
patthoyts added on 2008-11-15 07:37:30:
backported to 8.5 patthoyts added on 2008-11-15 07:05:19: Examination of the code for [wm manage] shows that although the command accepts any widget in reality only frames and labelframes are acceptable. In some places the Tk_Window instanceData member is cast to a Frame pointer and some members of the Frame structure are written. If this is not a frame widget then that will not be a Frame structure and we overwrite members about which we know nothing. I've added a check to the [wm manage] command to ensure that only frames and labelframes are accepted. Any other widget will result in an error. Unfortunately this includes ttk::frames as their private data is not a Frame structure either. patthoyts added on 2008-11-13 15:47:27: If you add a 'raise .f' after the 'wm manage .f' the new toplevel will become visible. My understanding was that only frames and labelframes (or their ttk equivalents) could be managed but the code does exclude other widgets and managing a text widget causes a crash when I raise it on windows. The relevant document is TIP 125 ( http://tip.tcl.tk/125 ) which seems to be specifying Frame class widgets for this. So probably a documentation bug and we need to exclude unacceptable widgets or we must fix the crash (dereferencing an bad pointer for menuName in TkpMenuNotifyToplevelCreate). | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki