From: Kevin W. <kw...@co...> - 2009-11-26 02:33:07
|
On 11/25/09 10:48 AM, Kevin Walzer wrote: > I'm trying to implement an extension that draws custom sheets in > Tk-Cocoa, so that a custom dialog or window can slide down from the top > of the window, as they do with tk_messageBoxes that have a "-parent" > flag set. > > I'm making some progress, but the outcome isn't what I expect. I can get > the sheet to draw, but instead of animating, it completely overlays its > parent window, and then blocks the application. Also, only the topmost > widget in the sheet is displayed, i.e. a frame; its child widgets, > including the button to close the sheet, are not drawn. > > It would be nice to get this working natively. I've actually developed a > script-level package that provides a decent implementation of sheets by > animating a frame via repeated calls to "place," but it doesn't look > quite right--there's no drop shadow on it, so I have to set the right > type of relief on the widget. However, if I can't get custom sheets > working, then I'll go with the script-level package. Update: Some good progress, the issue isn't with my C-level code, it's correctly managing the drawing and window geometry of the window when the sheet is drawn. There isn't a perfect correlation between Tk's window-mapping functions and animating the sheet, i.e. I can't just run the "sheet" command and have the sheet automagically draw in the correct position. When I release this as open source, I'll either have to include some script-level routines for drawing the window with correct placement or, at the very least, some documentation. Still, I'm pleased that this is moving forward. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com |