From: Jim I. <ji...@ap...> - 2005-03-17 18:39:12
|
Neil, Ooh, the TclObj version is SO pretty... Would you mind if I just put in the changes to the MacWindowStyle, and leave out the Drawer stuff for now? IMHO, the drawer should really be another command along the lines of the "toplevel" command. I would expect to do: drawer .drawer -parent . -side left .drawer close etc. That's much more like the Tk style for widgets. I'm not so happy with having it be a weird toplevel with commands hanging off the MacWindowStyle command... OTHO, the rewrite of the Unsupported1 command is great, and the old code really did make my eyes bleed... So I would like to get that in right away. If this is okay with you, I'll check it on in. Jim On Mar 16, 2005, at 2:53 PM, Neil Madden wrote: > All, > > I've uploaded a preliminary patch to sf.net[1] which is an overhaul > of the MacWindowStyle command to use new Tcl_Obj APIs. In > particular, use of Tcl_GetIndexFromObj(Struct) cuts down the code > by quite a bit (~100 lines), and removes all use of strcmp etc. The > reason for doing this was to preserve my sanity while trying to add > in support for drawer-style windows, which is the other half of the > patch (which adds back in ~180 lines, giving a net gain, but hey... :) > > The drawer-window code works for what it does, but the event > handling/redrawing is broken (move the main window about and watch > the drawer zoom off the screen). IIRC, this is something to do with > drawer windows using compositing/CG vs Tk using QuickDraw > (different coordinates etc)? I think it might be solveable. As I > might not have time to look at this again for a little while, I > thought I'd upload the patch as is, in case anyone else wants to > play with it, and maybe get it working... > > Ooh... the patch also adds some support for metal windows, if you > like that kind of thing (hate them, myself). Here's a test script: > > > tk::unsupported::MacWindowStyle style . document {metal > standardDocument} > > toplevel .drawer > tk::unsupported::MacWindowStyle style .drawer drawer none > > proc toggle {d} { > tk::unsupported::MacWindowStyle drawer $d open > } > > grid [button .sb -text "Drawer" -command [list toggle .drawer]] - > row 0 \ > -column 0 -sticky e > grid [text .t -highlightthickness 0 \ > -yscrollcommand [list .vsb set] \ > -xscrollcommand [list .hsb set]] -sticky news -row 1 -column 0 > grid [scrollbar .vsb -orient vertical -command [list .t yview]] \ > -row 1 -column 1 -sticky ns > grid [scrollbar .hsb -orient horizontal -command [list .t xview]] \ > -row 2 -column 0 -sticky ew > grid rowconfigure . 1 -weight 1 > grid columnconfigure . 0 -weight 1 > pack [text .drawer.t -highlightthickness 0 -width 30] -fill both - > expand 1 > > update ;# Make the window really exist > tk::unsupported::MacWindowStyle drawer .drawer parent . > tk::unsupported::MacWindowStyle drawer .drawer side left > tk::unsupported::MacWindowStyle drawer .drawer close > tk::unsupported::MacWindowStyle drawer .drawer open > > and here's a screenshot of that running: > > http://www.cs.nott.ac.uk/~nem/drawer.jpg > > Hope this is of use to someone. > > Cheers, > > Neil > > [1] https://sourceforge.net/tracker/index.php? > func=detail&aid=1164857&group_id=12997&atid=312997 > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Tcl-mac mailing list > Tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac |