From: Mats B. <ma...@pr...> - 2005-08-18 21:30:26
|
On my 10.2.8 box I experience drawing glitches on buttons when the focus ring is being drawn. shot: http://www.visit.se/~matben/TileButtonStates.png code: http://www.visit.se/~matben/ButtonStates.tcl This seems to be related to the so called 'adornmment' memeber of ThemeButtonDrawInfo. Experimenting with tiles mapping: static Ttk_StateTable ButtonAdornmentTable[] = { { kThemeAdornmentDefault, TTK_STATE_ALTERNATE, 0 }, { kThemeAdornmentFocus, TTK_STATE_FOCUS, 0 }, { kThemeAdornmentNone, 0, 0 } }; has proven unsuccesful, and I have an increasing suspicion that this is an Apple bug. Question: What does it look like on post 10.2 systems? /Mats PS: my firefox/mozialla doesn't draw any button focus rings at all and show no glitches. They seem to use similar APIs for drawing widgets and elements as tile does. PSS: the focus ring can be switched off for buttons using static void ButtonElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state) { Rect bounds = BoxToRect(Ttk_PadBox(b, ButtonMargins)); ThemeButtonParms *parms = clientData; ThemeButtonDrawInfo info; if (parms->kind == kThemePushButton) { state &= ~TTK_STATE_FOCUS; } info = computeButtonDrawInfo(parms, state); BEGIN_DRAWING(d) DrawThemeButton(&bounds, parms->kind, &info, NULL/*prevInfo*/,NULL/*eraseProc*/,NULL/*labelProc*/,NULL/*userData*/); END_DRAWING } |