Tk Source Code

Check-in [98162ffd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor fix of wm forget implementation on Aqua
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tk-cocoa-8-5-backport
Files: files | file ages | folders
SHA1: 98162ffd3b88675d2cc0f071cca0022843d8f975
User & Date: kevin_walzer 2011-07-26 12:41:28
Context
2011-07-26
13:53
"Fix toolbar demo to reflect wm manage implementation on Aqua" check-in: 8e535e05 user: kevin_walzer tags: tk-cocoa-8-5-backport
12:41
Minor fix of wm forget implementation on Aqua check-in: 98162ffd user: kevin_walzer tags: tk-cocoa-8-5-backport
2011-07-20
02:25
Fix version mismatch in Tk-Cocoa backport check-in: 40668d8e user: kevin_walzer tags: tk-cocoa-8-5-backport
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to library/demos/toolbar.tcl.

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
set w .toolbar
destroy $w
toplevel $w
wm title $w "Toolbar Demonstration"
wm iconname $w "toolbar"
positionWindow $w

if {[tk windowingsystem] ne "aqua"} {
    ttk::label $w.msg -wraplength 4i -text "This is a demonstration of how to do\
	    a toolbar that is styled correctly and which can be torn off. The\
	    buttons are configured to be \u201Ctoolbar style\u201D buttons by\
	    telling them that they are to use the Toolbutton style. At the left\
	    end of the toolbar is a simple marker that the cursor changes to a\
	    movement icon over; drag that away from the toolbar to tear off the\
	    whole toolbar into a separate toplevel widget. When the dragged-off\







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
set w .toolbar
destroy $w
toplevel $w
wm title $w "Toolbar Demonstration"
wm iconname $w "toolbar"
positionWindow $w

if {[tk windowingsystem] ne {}} {
    ttk::label $w.msg -wraplength 4i -text "This is a demonstration of how to do\
	    a toolbar that is styled correctly and which can be torn off. The\
	    buttons are configured to be \u201Ctoolbar style\u201D buttons by\
	    telling them that they are to use the Toolbutton style. At the left\
	    end of the toolbar is a simple marker that the cursor changes to a\
	    movement icon over; drag that away from the toolbar to tear off the\
	    whole toolbar into a separate toplevel widget. When the dragged-off\
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    pack $t.tearoff.to2 -fill y -expand 1 -side left
}
ttk::frame $t.contents
grid $t.tearoff $t.contents -sticky nsew
grid columnconfigure $t $t.contents -weight 1
grid columnconfigure $t.contents 1000 -weight 1

if {[tk windowingsystem] ne "aqua"} {
    ## Bindings so that the toolbar can be torn off and reattached
    bind $t.tearoff     <B1-Motion> [list tearoff $t %X %Y]
    bind $t.tearoff.to  <B1-Motion> [list tearoff $t %X %Y]
    bind $t.tearoff.to2 <B1-Motion> [list tearoff $t %X %Y]
    proc tearoff {w x y} {
	if {[string match $w* [winfo containing $x $y]]} {
	    return







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    pack $t.tearoff.to2 -fill y -expand 1 -side left
}
ttk::frame $t.contents
grid $t.tearoff $t.contents -sticky nsew
grid columnconfigure $t $t.contents -weight 1
grid columnconfigure $t.contents 1000 -weight 1

if {[tk windowingsystem] ne {}"aqua"} {
    ## Bindings so that the toolbar can be torn off and reattached
    bind $t.tearoff     <B1-Motion> [list tearoff $t %X %Y]
    bind $t.tearoff.to  <B1-Motion> [list tearoff $t %X %Y]
    bind $t.tearoff.to2 <B1-Motion> [list tearoff $t %X %Y]
    proc tearoff {w x y} {
	if {[string match $w* [winfo containing $x $y]]} {
	    return

Changes to macosx/tkMacOSXWm.c.

1640
1641
1642
1643
1644
1645
1646

1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
    register Tk_Window frameWin = (Tk_Window)winPtr;

    if (Tk_IsTopLevel(frameWin)) {

	MacDrawable *macWin = (MacDrawable *) winPtr->parentPtr->window;
    	TkFocusJoin(winPtr);
    	Tk_UnmapWindow(frameWin); 

	RemapWindows(winPtr, macWin);
       
	TkWmDeadWindow(macWin);
	winPtr->flags &=~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);

	/*
         * Flags (above) must be cleared before calling TkMapTopFrame (below).
         */

	TkMapTopFrame(frameWin);







>


<







1640
1641
1642
1643
1644
1645
1646
1647
1648
1649

1650
1651
1652
1653
1654
1655
1656
    register Tk_Window frameWin = (Tk_Window)winPtr;

    if (Tk_IsTopLevel(frameWin)) {

	MacDrawable *macWin = (MacDrawable *) winPtr->parentPtr->window;
    	TkFocusJoin(winPtr);
    	Tk_UnmapWindow(frameWin); 
	TkWmDeadWindow(macWin);
	RemapWindows(winPtr, macWin);
       

	winPtr->flags &=~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);

	/*
         * Flags (above) must be cleared before calling TkMapTopFrame (below).
         */

	TkMapTopFrame(frameWin);