[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNUstep themeing and MacOS HITheme APIs...

From: Nicolas Roard
Subject: Re: GNUstep themeing and MacOS HITheme APIs...
Date: Fri, 5 Nov 2004 23:18:26 +0000

Le 5 nov. 04, à 22:50, M. Uli Kusterer a écrit :

In article <address@hidden>,
 Michael Hanni <address@hidden> wrote:

The latest NSTabView code
(http://www.cc.utah.edu/~msh3/gnustep/NSTabView-NG-0.02.tgz) has methods to draw the whole tab and for each side of the tab. In theory you could override
easily any of these methods to completely change the look of the tab.

Any chance of moving that into GSDrawFunctions? From what I understand, this is the recommended place for collecting drawing functions that need
to be replaced when themeing.

actually, yes, that would be good. Well, first, this patch needs to be committed, it's really nice !! then we could perhaps move the drawing methods to GSDrawFunctions -- not only the left and right tabs, but also the "top" of a tab and the border.. but well, we'll (I will ?) see that later :-)

 Hmmm... thinking of switching themes at runtime there: Shouldn't
GSDrawFunctions be made a singleton with all those methods being
instance methods instead of class methods? Then we could have:

   +(id) currentDrawFunctions;

which would give us the GSDrawFunctions object for the current theme, and

   -(void)  set;

to make a particular instance (or subclass) of GSDrawFunctions the
current theme that is returned by currentDrawFunctions.

Eh, nice idea, yes. The singleton object should perhaps be global, so it will be
easier to  access the methods (like NSApp).
It's effectively a better idea than having the themes doing a category to replace the GSDrawFunctions :-)
I'll try to implement that.

Oh, and is there any reason why GSDrawFunctions has unnamed parameters
as in

   +(NSRect) drawButton: (NSRect)border : (NSRect)clip;

? Wouldn't

   +(NSRect) drawButton: (NSRect)border clipTo: (NSRect)clip;

be more readable? I spent the first half minute looking for the "?" to
go with that standalone ":"...

well, I think the reasoning was to mimick the previous NS* drawing functions calls... In Camaelon now theses methods are only called indirectly, as basically there are specific methods in GSDrawFunctions to draw each widgets. I will try to commit the changes
once the pixmap theme engine will be completed.

Nicolas Roard
"Any sufficiently advanced technology is indistinguishable from magic."
 -Arthur C. Clarke

reply via email to

[Prev in Thread] Current Thread [Next in Thread]