This patch is a complete overhaul of the tk::unsupported::
MacWindowStyle command to use newer Tcl_Obj APIs (in particular,
use of Tcl_GetIndexFromObj(Struct) cuts down the code
considerably). I simplified some of the option handling, so it may not
behave exactly as it did before, and needs a bit more testing. In
addition, I added in preliminary code to support drawer-style windows.
This code definitely doesn't work quite right yet (weird event handling
issues), but I won't have time to correct these for a little while, so I'm
uploading the patch as is in case anyone else wants to work on it. All
the drawer code is factored out into a separate (internal) function, so
it should be pretty simple to remove. There is also an extra window
class "drawer". Most of the drawer code is implemented as a new
subcommand to MacWindowStyle "drawer":
MacWindowStyle drawer $dwin option ...
where option is
parent ?parent? -- set/get the drawer parent window
side ?top/bottom/left/right? -- set/get the preferred/actual side
offset ?{leading trailing}? -- set/get offsets (floats)
close -- close the drawer
open -- toggle the drawer open/closed
These should only be called after the window actually exists (e.g. Tk
has entered the idle loop after creating the window). It won't error if
called before then, but will have no effect.
As I said, there are issues with the drawer code. I can separate out
the rest of the patch, if wanted.
Overhauled MacWindowStyle and drawer-style windows
Logged In: YES
user_id=72656
Originator: NO
This languished a bit long. Some of the work is already implemented, including drawer bits, but I suspect more would be good. If you would like to update the patch for 8.5, that would be great.