[MACTCL] Numerous TkAqua changes committed, need testing
by Daniel A. Steffen other posts by this author
Apr 30 2007 1:34PM messages near this date
Re: [MACTCL] problem with getOpenFile
|
Re: [MACTCL] Numerous TkAqua changes committed, need testing
I have recently committed a very large TkAqua patch to the HEAD (just
in time for 8.5a6), as well as a backport to core-8-4-branch on the
weekend.
I have been working on this for several months and the AS folks have
graciously been testing it for a while, but given the large number of
changes, it would be very useful to have wider testing before 8.4.15
resp. 8.4b1 go final.
To ease testing, I have built disk images of the framework installers
and of the standalone Wish for both 8.4.15 (to be) and 8.5a6, as 4-
way universal (Tcl) resp. 2-way universal (Tk) binaries:
http://rutherglen.ics.mq.edu.au/~steffen/tcltk/TclTkAqua-8.4.15-
preview.dmg
http://rutherglen.ics.mq.edu.au/~steffen/tcltk/
TclTkAquaStandalone-8.4.15-preview.dmg
http://rutherglen.ics.mq.edu.au/~steffen/tcltk/TclTkAqua-8.5a6.dmg
http://rutherglen.ics.mq.edu.au/~steffen/tcltk/
TclTkAquaStandalone-8.5a6.dmg
Please test and file any new problems in the SF tktoolkit bugtracker.
Some details on the changes visible at script-level (for more, c.f.
excerpts from 'changes' & 'ChangeLog' below):
- triple-buffered drawing eliminated: by removing useless & wasteful
roundtrip through QD, most drawing is now CoreGraphics all the way to
the window, which improves performance and e.g. adds support for
colors with alpha.
- all appearance colors/brushes available as system colors, as well
as the fully transparent "color" 'systemTransparent': see colors.n
and screenshots at:
http://rutherglen.ics.mq.edu.au/~steffen/tcltk/sysCols/
(note highlight color was purple for aqua theme and green for
graphite theme)
This allows use of windows with pinstripe backgrounds etc. from pure
Tk, e.g. [tk_dialog] has been modified to use the background
appropriate for a moveableModal dialog by adding the following:
if {[tk windowingsystem] eq "aqua"} {
::tk::unsupported::MacWindowStyle style $w moveableModal {}
option add *Dialog*background systemDialogBackgroundActive
widgetDefault
option add *Dialog*Button.highlightBackground
systemDialogBackgroundActive widgetDefault
}
the color names (past the 'system' prefix) are those from
Appearance.h, without the 'kThemeBrush' prefix, resp. without
'kThemeBackground' prefix but 'Background' suffix, resp. without
'kThemeTextColor' prefix but 'Text' suffix. Legacy system color names
also still supported.
- all appearance cursors available, as well as the 'none' cursor: see
cursors.n, the cursor names are those from Appearance.h, in
lowercase, with 'kTheme' prefix and 'Cursor' suffix stripped.
- app modal sheet versions of tk_getOpenFile et al. dialogs when -
parent option given (but only if parent toplevel already exists):
making these app modal violates Aqua UI guidelines, but the current
tcl API does not support modeless dialogs (TIP needed to add a
callback scheme?).
- custom MDEF and tearoff menus fixed, compound menu items
implemented: to enable, [set ::tk::mac::useCustomMDEF 1] before menu
creation; with the (new) defaults of 'systemMenu' background and
'menu' font, the custom MDEF should look identical to the OS menus,
but adds of course support for custom colors & fonts, bitmaps etc.
As the MDEF code (and API) is very gnarly and a large amount needed
to be rewritten, this needs to be tested esp. carefully; for instance
I already know that menu scrolling is still buggy. For a quick test,
try the widget demo's menu and menubutton sections, they now have the
custom MDEF enabled.
- <<MenuSelect> > support added for menubar and menus without custom
MDEF; extraneous sending of <<MenuSelect> > fixed.
- asynchronous window dragging: windows can be dragged even when Tk
is not processing events; windows are constrained after dragging to
ensure titlebar is not inaccessible offscreen or under dock/menubar.
- live window resizing: enabled by default, window contents redraw
continuously during resizing, disable by removing 'liveResize'
attribute with [::tk::unsupported::MacWindowStyle style].
- transparent GrowBox: eliminates growbox borders but is not actually
transparent until we implement compositing.
- fix background event processing during tracking loops: timers,
fileevents, animations etc. are processed/displayed during mouse
tracking and other nested event loops (e.g. menutracking, modal
dialogs, window resizing etc).
- scrollbar fixes: all scrollbar variants and arrow positions now
supported as well as "jump to here"; changes to scrollbar variant
during app lifetime supported; min scrollbar height enforced to avoid
scrollbar component overlap.
- [wm attributes -topmost]: puts window into utility window group,
i.e. above the windows of all applications.
- [wm attributes -transparent]: makes window content region
transparent - before any Tk drawing takes place, i.e. need to use
partially or fully transparent background color for effect to show,
e.g. [. configure -bg systemTransparent]:
http://rutherglen.ics.mq.edu.au/~steffen/tcltk/sysCols/
transparentCanvas.png
(note that this is a png with transparency...)
- [wm attributes -fullscreen]: enlarges window to fill main screen
and enters 'suppressed' UI Mode when window is frontmost (i.e. menu
bar and dock hidden); adapt fullscreen window size when screen size
changes.
- window min/max size fixes: min size enforces visibility of titlebar
widgets & grow box, max size takes multiple displays into account;
add support for gridding.
- default initial window bounds determined by RepositionWindow() API,
cascaded on current frontmost window.
- [::tk::unsupported::MacWindowStyle style]: unusable attributes
removed and new attributes added; fixed composite attributes; allow
changing window class of already existing windows (if supported by
HIWindowChangeClass() API).
Cheers,
Daniel
----------------------------- from HEAD tk/changes
-----------------------------
2007-04-23 (enhancement) Allow empty value for -selectforeground option.
2007-04-23 (platform support) Aqua: remove Tk-internal double
buffering that is
wasteful on Aqua; allows direct-to-window CoreGraphics drawing (e.g.
adding
support for colors with alpha).
2007-04-23 (platform support) Aqua: add all OS theme colors/brushes
(patterns)
as system colors.
2007-04-23 (platform support) Aqua: use OS theme for tk_dialog and
bgerror.
2007-04-23 (platform support) Aqua: add 'none' cursor & missing theme
cursors.
2007-04-23 (platform support) Aqua: [tk_getOpenFile -parent] uses
sheet dialog.
2007-04-23 (bug fix) Aqua: fix custom MDEF and tearoff menu display.
2007-04-23 (bug fix)[1620826] Aqua: fix <<MenuSelect> > support.
2007-04-23 (platform support) Aqua: add support for live window
resizing and
asynchronous window dragging; prevent window from becoming inacessible
offscreen or under Dock after dragging; use transparent grow box.
2007-04-23 (platform support) Aqua: improve event processing during
nested
event loops (e.g. modal dialogs, menu tracking, window resizing etc).
2007-04-23 (bug fix) Aqua: add support for all possible aqua
scrollbar arrow
positions, scrollbar variants and for "jump to here" scrollbar
behaviour;
correct scroll view size computation; enforce minimal scrollbar height.
2007-04-23 (platform support) Aqua: add [wm attributes] -topmost, -
fullscreen
and -transparent (allows fully transparent window via -bg
"systemTransparent").
2007-04-23 (platform support) Aqua: determine win min/max sizes
dynamically;
correct size handling of gridded windows; improve computation of initial
window bounds; correct window size handling on multi-headed systems.
2007-04-23 (platform support) Aqua: correct composite attribute
handling in
[tk::unsupported::MacWindowStyle] and add new attributes; allow changing
window class of already existing windows.
2007-04-23 (platform support) Aqua: add tcl document extensions and
mime type
to Wish.app's Info.plist.
---------------------- from core-8-4-branch tk/ChangeLog
-----------------------
* generic/tkCanvas.c: allow -selectforeground option to be None; add
* generic/tkCanvText.c: fallback to fgColor when selFgColor is None
* generic/tkEntry.c: (new default on aqua to match native L&F).
* generic/tkListbox.c:
* generic/tkText.c:
* generic/tkCanvas.c: add support for bypassing all of Tk's double
* generic/tkEntry.c: buffered drawing into intermediate pixmaps
* generic/tkFrame.c: (via TK_NO_DOUBLE_BUFFERING #define), it is
* generic/tkListbox.c: unnecessary & wasteful on aqua where all
* generic/tkPanedWindow.c: drawing is already double-buffered by the
* generic/tkTextDisp.c: window server. (Use of this on other
* macosx/tkMacOSXPort.h: platforms would only require implementation
* unix/tkUnixScale.c: of TkpClipDrawableToRect()).
* library/bgerror.tcl: on aqua, use moveable alert resp. modal dialog
* library/dialog.tcl: window class and corresponding system
background pattern; fix button padding.
* library/tearoff.tcl: correct aqua menu bar height; vertically offset
* library/tk.tcl: aqua tearoff floating window to match menu.
* library/demos/menu.tcl: on aqua, use custom MDEF and tearoffs;
* library/demos/menubu.tcl: correct menubutton toplevel name.
* library/demos/puzzle.tcl: fix button size & padding for aqua.
* macosx/tkMacOSXCarbonEvents.c: add window event target carbon event
* macosx/tkMacOSXEvent.c: handler for all kEventClassWindow and
* macosx/tkMacOSXEvent.h: kEventClassMouse events; move all
* macosx/tkMacOSXNotify.c: remaining events except for
* macosx/tkMacOSXWindowEvent.c: kEventClassKeyboard from dispatcher to
application event handler; pass event handler callRef downstream; fix
debug event tracing; process all tcl event types in carbon event timer;
delay carbon event timer first fire; add TkMacOSXTrackingLoop() to mark
enter/exit of event tracking loop during which all tcl events but only
carbon update events should be processed by the timer (replaces various
calls to Tcl_SetServiceMode()); rename TkMacOSXReceiveAndProcessEvent()
to TkMacOSXReceiveAndDispatchEvent(), move it from tkMacOSXEvent.c to
tkMacOSXCarbonEvents.c and modify it to dequeue only update events
during a tracking loop; add TkMacOSXRunTclEventLoop() to standardize
the various ways in use to run the tcl event loop; add handling of
kEventClassAppearance events (for ScrollBarVariantChanged event).
* macosx/tkMacOSXDialog.c: use new TkMacOSXTrackingLoop() around
* macosx/tkMacOSXEvent.c: blocking API that puts up modal dialogs
* macosx/tkMacOSXMenu.c: or when entering/exiting menu/control
* macosx/tkMacOSXMouseEvent.c: tracking, window dragging and other
* macosx/tkMacOSXScale.c: mouse tracking loops.
* macosx/tkMacOSXScrlbr.c:
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXWm.c:
* macosx/tkMacOSXDialog.c: use new TkMacOSXRunTclEventLoop()
* macosx/tkMacOSXScale.c: instead of Tcl_DoOneEvent(),
* macosx/tkMacOSXScrlbr.c: Tcl_ServiceAll(), TclServiceIdle()
* macosx/tkMacOSXWindowEvent.c: and Tcl_GlobalEval("update idletasks").
* macosx/tkMacOSXColor.c: make available as Tk system colors all
* macosx/tkMacOSXPort.h: appearance manager brushes, text colors and
backgrounds with new and legacy names, as well as the fully transparent
color "systemTransparent"; add TkMacOSXSetColorIn{Port,Context}() to
directly set an X pixel color value in the current QD port resp. the
given CG context without requiring passage through rgb representation
(lossy for most system colors); modernize/remove Classic-era code;
replace crufty strcmp() elseifs by Tcl_GetIndexFromObjStruct().
* macosx/tkMacOSXButton.c: use new TkMacOSXSetColorInPort()
* macosx/tkMacOSXDraw.c: instead of setting rgb color directly
* macosx/tkMacOSXMenubutton.c: to allow for non-rgb system colors.
* macosx/tkMacOSXCursor.c: implement "none" cursor as on other
platforms [Patch 1615427]; add all missing appearance manager cursors.
* macosx/tkMacOSXDefault.h: set SELECT_FG_COLORs to None to match aqua
L&F; use standard system color names; use new 'menu' system font;
correct default scrollbar width.
* macosx/tkMacOSXDialog.c: make -parent option of tk_getOpenFile et al.
use the sheet version of NavServices dialogs; ensure native parent win
exists before using StandardSheet API for tk_messageBox [Bug 1677611];
force sheets to behave like app-modal dialogs via WindowModality() API;
use more modern ColorPicker API.
* macosx/tkAboutDlg.r: use themed movable modal dialog, fix (c) year.
* macosx/tkMacOSXFont.c: use appearance manager API to map system font
* macosx/tkMacOSXFont.h: names to TkFonts; add "menu" system font for
menu item text drawing from MDEF; disable broken QD stippling.
* macosx/tkMacOSXMenu.c: large-scale rewrite of custom
* macosx/tkMacOSXMenu.r (removed): MDEF and related code that
* unix/Makefile.in: restores many longtime-MIA
features to working order (e.g. images, custom colors & fonts in menus
etc); implement compound menu items; use Appearance Mgr and ThemeText
APIs to mimic native MDEF as closely as possible when default "menu"
system font is used; remove now obsolete SICN drawing code and
resources.
* macosx/tkMacOSXCarbonEvents.c: handle additional menu carbon events
* macosx/tkMacOSXEvent.c: in order to support <<MenuSelect> > in
* macosx/tkMacOSXMenu.c: the menubar and in menus that are not
* macosx/tkMacOSXMenus.c: using the custom MDEF [Bug 1620826];
fix early and missing clearing of current Tk active menu entry; fix
extraneous sending of <<MenuSelect> > during active menu entry clearing.
* macosx/tkMacOSXMouseEvent.c: add support for async window dragging by
the window server; set the corresponding window attribute by default.
* macosx/tkMacOSXScrlbr.c: use appearance manager API to retrieve
scrollbar component metrics; add awareness of multiple possibilites for
scrollbar arrow position in aqua and handle user changes to arrow
position pref; handle difference in metrics of small & large scrollbar
variants; handle aqua "jump to here" scrollbar behaviour; correct
computation of scroll view size and position; enforce min scrollbar
height to avoid scrollbar component overlap; erase scrollbar area
outside of standard width; remove broken auto-adjust code; account for
window class when leaving space for grow box; remove code to manually
draw grow box; use modern API for thumb scroll proc; replace
HiliteControl() by modern API; replace control mgr constants with
appearance mgr equivalents.
* macosx/tkMacOSXWindowEvent.c: handle only the first of a batch of
kEventAppAvailableWindowBoundsChanged events sent per transaction;
handle kEventWindowBoundsChanged event to support live window resizing
and centralized sending of location/size changed ConfigureNotify
events; ensure HIGrowBox is redrawn after bounds change; constrain
window after dragging to ensure titlebar is not inacessible
offscreen or under dock/menubar; handle kEventWindowGetRegion and
kEventWindowDrawContent for transparent windows to mark resp. paint
content region as transparent; handle kEventWindowConstrain for
fullscreen windows to ensure bounds match new screen size; enter/exit
fullscreen UIMode upon activation/deactivation of fullscreen window.
* macosx/tkMacOSXWm.c: use live-resize and async-drag carbon window
* macosx/tkMacOSXWm.h: attributes for toplevels by default; implement
new [wm attributes] -topmost, -transparent and -fullscreen; refactor
WmAttributesCmd() parallelling the tkUnixWm.c implementation, use thus
factored proc to set proxy icon from [wm iconbitmap]; dynamically
determine default values for toplevel min and max sizes (similar to
tkWinWm.c impl): min sizes depend on window class & attributes to
ensure visibility of all titlebar widgets and grow box, max sizes
depend on maximal window bounds for all active displays; factor out
code that puts into effect changes to master or override_redirect; use
RepositionWindow() API to determine staggered initial window bounds;
correct resize limit calculations, handle gridding and use modern
resize API in TkMacOSXGrowToplevel(); remove sending of ConfigureNotify
after resize or zoom (now handled by BoundsChanged handler); correct
composite carbon window attribute handling, remove currently unusable
attributes and add new attributes in [tk::unsupported::MacWindowStyle];
ensure validity of window class and attributes before use; apply
changes to window class when handling carbon window attribute changes
(if HIWindowChangeClass() API available); add debug build warning
message when deprecated window style is used instead of window class;
use transparent HIGrowBox for resizable windows; avoid unnecessary
calls to window structure width API; use tcl time API in TkpGetMS();
add TkMacOSXEnterExitFullscreen() to enter/exit UIMode with dock and
menubar hidden; restrict wmTracing output to debug builds; remove
unneeded calls to TkMacOSXInvalClipRgns() and unnecessary setting of QD
port; workaround GetWindowStructureWidths() Carbon bug (bogus results
for never-mapped floating windows).
* macosx/Wish-Info.plist.in: add tcl document extensions/mime types and
LSMinimumSystemVersion, LSRequiresCarbon & NSAppleScriptEnabled keys.
* doc/colors.n: document new Mac OS X system colors.
* doc/cursors.n: document new Mac OS X native cursors.
* doc/font.n: document new Mac OS X 'menu' system font.
* doc/wm.n: document new Mac OS X [wm attributes].
--
** Daniel A. Steffen Dept. of Mathematics **
** Macquarie University NSW 2109 Australia **
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Tcl-mac mailing list
tcl-mac@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-mac
Thread:
Daniel A. Steffen
David Zolli
Uwe Koloska
Russell E. Owen
Russell E. Owen
Russell E. Owen
Russell E. Owen
Neil Madden
Revar Desmera
Kevin Walzer
Kevin Walzer
Dorothy Robinson
Mats Bengtsson
Daniel A. Steffen
Mats Bengtsson
Daniel A. Steffen
Mats Bengtsson
Mats Bengtsson
Mats Bengtsson
Kevin Walzer
Kevin Walzer
Daniel A. Steffen
Kevin Walzer
Michael Kirkham
Kevin Walzer
Daniel A. Steffen
Kevin Walzer
Daniel A. Steffen
Christopher Sean Morrison
Daniel A. Steffen
Adrian Robert
Daniel A. Steffen
Adrian Robert
Uwe Koloska
Christopher Sean Morrison
Daniel A. Steffen
|