[Y-devel] About widget implementation

Chris Amshey ychris at amshey.net
Sat Mar 13 00:11:20 GMT 2004


On Fri, Mar 12, 2004 at 02:23:04PM -0500, Casey Winans wrote:
> 
> I was quick to respond before.. I now see your point. I agree that this
> is redundant. I would be in favor of removing it from basicDrawLabel
> (and all other [theme_name]Draw[widget_name] functions) so that it's
> done in one place and each theme doesn't have to worry about the
> painter's state... just its current job.
> 
> -- 
> Casey Winans <casey at cwinans.com>
> 

That almost makes sense, but the problem is [theme name]Draw* functions
do not have to be called from widget/*.c, they can be called from somewhere
in a theme module (like simpleDrawButton calls simpleDrawButtonPane), 
although -currently- all Draws are -either- utility draws called from
within a theme or widget draws called from widget/*.c.

I think, though, that the save/restore painter belongs in Y/module/theme.c,
mostly, and then anyone calling themeDraw* doesn't need to worry about it,
and if [theme name]Draw* want to call something directly within their theme,
they can save/restore themselves.
(ie,
 painterSaveState(args);
 simpleDrawButtonPane(args);
 painterRestoreState(args);
for that case, and 
 themeDrawSomething(args);
for the general case.)

--Chris





More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved