From: Tim J. <tj...@to...> - 2004-03-22 19:09:35
|
Also, keep in mind that the stripes are totally gone under 10.3 (Panther) in exchange for the more elegant grey/silver tones. Now, the metal windows are whole 'nother story. Tim On Mar 22, 2004, at 11:22 AM, Jim Ingham wrote: > Uwe, > > I don't think this is the right way to go, this seems like hacking > around what we are very close to having a real solution for... > > What we really need is for Tk to handle colors symbolically, which is > what the Named Colors TIP proposes (that doesn't seem too far from > being completed either). Then one of the named colors would be > SystemBackground or something like, and since that would actually make > its way down into the platform layer as a named color object, we could > translate it on MacOS X to the pinstripes. The problem with doing it > any other way is that currently Tk really wants to change the color > string you passed in to the widget into an RGB color, so the "" or > whatever is going to get lost. We have some hacks in the Mac OS X > code to make fake RGB colors that we then decode into system defaults > down in the platform code, but this is pretty awful. I would rather > not continue along this route. > > Once we can really do symbolic colorw, we could make that the platform > default for frames if we think that is a good idea, though looking at > most modern Aqua apps, the stripes are used pretty sparingly. So we > will have to experiment with this. But anyway, you can use the option > database to fix this up if you don't like the default we choose. > > For buttons, you are going to have to set the -selectbackground to the > SystemBackground or whatever. The only way around this would be to > make the buttons truly non-rectangular. Mac OS 10.3 actually does > have API's to get the shape of a control, so this might be worth > experimenting with. But OTOH, Tk really does think all widgets are > rectangular, and I am not sure what kind of trouble we would get into > violating that, and OTOH, I don't think that we will want to restrict > even the 8.5 release to Panther or greater... > > Lining up the pinstripes is another difficult bit. It would probably > be enough to line up any widget with its parent if its parent also had > the pinstripe background, but I have to think about this a little > more. > > Jim > > > On Mar 22, 2004, at 1:53 AM, Uwe Kirschner wrote: > >> thanks neil, thanks jim, >> >> the label-with-pinstipe-image approach is actually way i am doing >> right now. >> >> this has several drawbacks: >> - backgrounds on buttons, checkbuttons etc... as you mentioned >> - alignment: once you need to use more than one "frame-label" the >> pinstripes do not always line up >> - since i do not know how to tile an image, i must potentially >> allocate huge photo images (1900x1200???). a bitmap might require >> less storage internally but takes a lot of bytes to define??? >> >> >> what do you think about this: >> 1) enhance the toplevel widget to support a background image which - >> if smaller than the window size - would be automatically replicated >> in x and y. >> >> 2) allow background color "" in all widgets. if color "" is >> encountered while drawing the widget, it would mean "use as >> background whatever is unterneath". -bg "" is already implemented for >> toplevels and frames. "use what is underneath" is already implemented >> for compositing images with transparency. so the approach would be >> consistent with what is already there. >> >> i think that this would suffice to create the aqua pinstripe look (or >> even something close to brushed metal) or to create skinned >> applications which are requested frequently. >> >> given these two changes in tk, to create aqua pinstripes i would have >> to: >> - tk_setPalette to a color i like >> - create a 1x4 bitmap image and set its fg and bg colors 2 or 3 >> notches plus/minus the palette's bg color. >> - assign the image to the toplevel >> - do an option set *Background "" >> >> what do you think? >> >> kind regards, >> uwe >> >> >> >> Am 21.03.2004 um 19:01 schrieb Neil Madden: >> >>> You can achieve a similar effect with an image and a canvas. The >>> following looks roughly right to me: >>> >>> image create photo AquaPinstripe >>> AquaPinstripe put {{#f3f3f3} {#f3f3f3} {#f6f6f6} {#f6f6f6}} -to 0 0 >>> 50 50 >>> pack [label .l -image AquaPinstripe] >>> >>> If you do the same, but using a canvas image type, you can then pack >>> stuff into the canvas, and get the nice background (so long as you >>> make the image big enough, or tile it). The only annoying thing is >>> the white border around buttons. I'm currently using this to make a >>> toolbar. At present I use the square buttons (using an image to get >>> the square shape), but I might write some code to draw the buttons >>> directly on the canvas using images/canvas bindings. If I do, I'll >>> put the code on the wiki. >>> >>> Neil. >>> >>> On 19 Mar 2004, at 22:49, Jim Ingham wrote: >>> >>>> Not right now. >>>> >>>> The main problem is that Tk currently really wants the -bg option >>>> to be an RGB color, or reducible to such, which obviously doesn't >>>> work for the Aqua pattern... Once we get the named color TIP in >>>> place, then we should be able to use that to express the fact that >>>> the background should be one of the Aqua Theme brushes. Then we >>>> will have to fix the drawing code to actually draw patterns. Of >>>> course, then we need to make sure the patterns drawn into all the >>>> frames in the window line up, etc... >>>> >>>> To do metal, we also need some way to tell Tk to use the metal >>>> window decorations, etc. I don't know whether there is an API to >>>> switch a carbon app to use Metal... I am not so keen to take this >>>> on, it would need a champion who was willing to do the work for >>>> this to happen. >>>> >>>> Jim >>>> >>>> On Mar 19, 2004, at 3:50 AM, Uwe Kirschner wrote: >>>> >>>>> hi all, >>>>> has anybody got an idea how to achieve the aqua background pattern >>>>> (i mean the fine white/grey stripes that appear as background in >>>>> native aqua windows)? >>>>> >>>>> (i'd go with brushed metal, too but i guess that would be even >>>>> more complex) >>>>> >>>>> kind regards, >>>>> uwe >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------- >>>>> This SF.Net email is sponsored by: IBM Linux Tutorials >>>>> Free Linux tutorial presented by Daniel Robbins, President and CEO >>>>> of >>>>> GenToo technologies. Learn everything from fundamentals to system >>>>> administration.http://ads.osdn.com/? >>>>> ad_id=1470&alloc_id=3638&op=click >>>>> _______________________________________________ >>>>> Tcl-mac mailing list >>>>> Tc...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/tcl-mac >>>>> >>>> -- >>>> Jim Ingham ji...@ap... >>>> Developer Tools >>>> Apple Computer >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.Net email is sponsored by: IBM Linux Tutorials >>>> Free Linux tutorial presented by Daniel Robbins, President and CEO >>>> of >>>> GenToo technologies. Learn everything from fundamentals to system >>>> administration.http://ads.osdn.com/? >>>> ad_id=1470&alloc_id=3638&op=click >>>> _______________________________________________ >>>> Tcl-mac mailing list >>>> Tc...@li... >>>> https://lists.sourceforge.net/lists/listinfo/tcl-mac >>> >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: IBM Linux Tutorials >> Free Linux tutorial presented by Daniel Robbins, President and CEO of >> GenToo technologies. Learn everything from fundamentals to system >> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >> _______________________________________________ >> Tcl-mac mailing list >> Tc...@li... >> https://lists.sourceforge.net/lists/listinfo/tcl-mac >> > -- > Jim Ingham ji...@ap... > Developer Tools > Apple Computer > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Tcl-mac mailing list > Tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac > |