[Y-devel] State of the Widgets

Fred P. fprog26 at hotmail.com
Fri Feb 27 23:50:13 GMT 2004


https://www.y-windows.org/pipermail/y-devel/2004-February/000772.html


You guys are making WAY TOO complicated, when it could be much simpler than 
that...

When you draw a "Shape" that "Shape" knows where it's located, how big it is
and what's inside it or not. All you need to do is have such "background 
Shape"
and attach to it an "Event handler" saying to attach button click to that 
"background shape"
That background shape acts like a container and handle events.

So, the server knows what its inside a shape not the theme.

The theme just say that's my button background
draw it with ellipse. and the server knows that the ellipse are the border 
for such action events.
More than that it knows, (x,y,w,h) and can perform any calculation on such.

That's how we do it in SVG GUI...

Fred.




Hi Chris,

Chris Amshey wrote:

>In any case, my proposal for a solution is very simply an API along
>the lines of, 'bool themeInWidget(widget *self, int x, int y)',
>modified for compatibility of calling convention with whatever Mark's
>doing to the theme API right now. This should, I think, be called from
>whoever's really making the action decisions, whether that's where
>it is now or in a UI module.

what you'd probably want is methods like:

   themeInButton (struct Button *, int, int);
   themeInCheckbox (struct Checkbox *, int, int);
   themeInCheckboxBox (struct Checkbox *, int, int);
   themeInSlider (struct Slider *, int, int);
   themeInSliderTrough (struct Slider *, int, int);
   themeInSliderThumb (struct Slider *, int, int);

and so forth.

You might also need things like:

   int themeSliderPositionToIndex (struct Slider *);

to convert a particular trough "hit" into an index value on the slider.

For now I think the "behaviour" of widgets can be hard-coded into the
widget code itself.  If we decide behaviour modules are a good idea it
won't be hard to pull it out later, and it'll probably have a better API
than if we come up with a random one now.

In fact, I'd prefer this sort of mechanism over the ugly WindowRegions
hack I have in the windowmanager/theme interaction.

Anyone want to work on this?

Regards,

   Mark.

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
https://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca




More information about the Y-devel mailing list









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