[Y-devel] State of the Widgets
Carl Jantzen carl at doopokko.net
Sat Feb 28 01:46:31 GMT 2004
I agree with Fred. Java implements a very similar method, where anything
can implement a MouseListener. The MouseListener recieves MouseEvents
whenever the mouse is moved, clicked, or released.
Continuing Fred's example, the Shape, which could be a button Widget,
might have an eliptical shape, but would still have a rectangular bounding
box. If the mouse was clicked in the box, the Widget/Shape would recieve a
MouseClicked event, which would contain the coordinates relative to the
widget of the click. It would then be trivial to calculate whether or not
that click occured on the button or on the background surrounding it.
-Carl
On Fri, 27 Feb 2004 18:50:13 -0500, Fred P. <fprog26 at hotmail.com> wrote:
> 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.
--
Using M2, Opera's revolutionary e-mail client: https://www.opera.com/m2/
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved