Tk Source Code

Check-in [399c1c0b]
Login

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

Overview
Comment:Revert unintended commit of menubutton file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 399c1c0bd57cd3109d58016043294a02f589d32b
User & Date: kevin_walzer 2014-12-21 04:16:44
Context
2014-12-24
04:43
All on Tk/Cocoa: Improve view performance during resizing; implement custom drawing of scroller to remove flickering and ghosted appearance during window operations; reduce flickering of menubutton during resizing, but do not completely eliminate ghosted rendering when widget is unmapped check-in: 6d14dd47 user: kevin_walzer tags: trunk
2014-12-21
04:16
Revert unintended commit of menubutton file check-in: 399c1c0b user: kevin_walzer tags: trunk
04:11
Minor optimization of drawing code in OSX check-in: f98361a0 user: kevin_walzer tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to macosx/tkMacOSXMenubutton.c.

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
    [fixForStyle(NSRoundedBezelStyle)] =	    { 14, 10, -2, -1},
    [fixForStyle(NSRegularSquareBezelStyle)] =	    {  6, 13, -2,  1, 1},
    [fixForStyle(NSShadowlessSquareBezelStyle)] =   { 15,  0, 2 },
};

#endif



/*
 * Forward declarations for procedures defined later in this file:
 */

static void MenuButtonEventProc(ClientData clientData, XEvent *eventPtr);

/*
 * The structure below defines menubutton class behavior by means of functions
 * that can be invoked from generic window code.
 */

Tk_ClassProcs tkpMenubuttonClass = {
    sizeof(Tk_ClassProcs),	/* size */
    TkMenuButtonWorldChanged,	/* worldChangedProc */
};

/*
 *----------------------------------------------------------------------
 *
 * TkpCreateMenuButton --
 *
 *	Allocate a new TkMenuButton structure.







<
<






<
<
<
<
<
<
<
<
<







56
57
58
59
60
61
62


63
64
65
66
67
68









69
70
71
72
73
74
75
    [fixForStyle(NSRoundedBezelStyle)] =	    { 14, 10, -2, -1},
    [fixForStyle(NSRegularSquareBezelStyle)] =	    {  6, 13, -2,  1, 1},
    [fixForStyle(NSShadowlessSquareBezelStyle)] =   { 15,  0, 2 },
};

#endif



/*
 * Forward declarations for procedures defined later in this file:
 */

static void MenuButtonEventProc(ClientData clientData, XEvent *eventPtr);











/*
 *----------------------------------------------------------------------
 *
 * TkpCreateMenuButton --
 *
 *	Allocate a new TkMenuButton structure.
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
 *----------------------------------------------------------------------
 */

TkMenuButton *
TkpCreateMenuButton(
    Tk_Window tkwin)
{
    MacMenuButton *macButtonPtr =
	    (MacMenuButton *) ckalloc(sizeof(MacMenuButton));

    macButtonPtr->button = nil;

    Tk_CreateEventHandler(tkwin, ActivateMask,
	    MenuButtonEventProc, (ClientData) macButtonPtr);
    return (TkMenuButton *) macButtonPtr;
}

/*
 *----------------------------------------------------------------------







|
<


<







83
84
85
86
87
88
89
90

91
92

93
94
95
96
97
98
99
 *----------------------------------------------------------------------
 */

TkMenuButton *
TkpCreateMenuButton(
    Tk_Window tkwin)
{
    MacMenuButton *macButtonPtr = ckalloc(sizeof(MacMenuButton));


    macButtonPtr->button = nil;

    Tk_CreateEventHandler(tkwin, ActivateMask,
	    MenuButtonEventProc, (ClientData) macButtonPtr);
    return (TkMenuButton *) macButtonPtr;
}

/*
 *----------------------------------------------------------------------
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
    NSRect frame;
    int enabled;

    mbPtr->flags &= ~REDRAW_PENDING;
    if (!tkwin || !Tk_IsMapped(tkwin) || !view ||
	    !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) {
	return;
    } 
    CGContextConcatCTM(dc.context, t);
    Tk_Fill3DRectangle(tkwin, (Pixmap) macWin, mbPtr->normalBorder, 0, 0,
	    Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
    if ([button superview] != view) {
	[view addSubview:button];
    }
    enabled = !(mbPtr->state == STATE_DISABLED);







|







156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
    NSRect frame;
    int enabled;

    mbPtr->flags &= ~REDRAW_PENDING;
    if (!tkwin || !Tk_IsMapped(tkwin) || !view ||
	    !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) {
	return;
    }
    CGContextConcatCTM(dc.context, t);
    Tk_Fill3DRectangle(tkwin, (Pixmap) macWin, mbPtr->normalBorder, 0, 0,
	    Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
    if ([button superview] != view) {
	[view addSubview:button];
    }
    enabled = !(mbPtr->state == STATE_DISABLED);