[Xwt.Drawing] EventHandler for Canvas OnDraw ?

72 views
Skip to first unread message

Hywel

unread,
Apr 24, 2013, 11:00:04 AM4/24/13
to xwt-...@googlegroups.com
It appears that the only way to handle 'ExposeEvents' (as Gtk# termed
them) is to subclass Canvas and override 'OnDraw' - there seems to be no
equivalent of (for example) :-

Canvas canvas = new Canvas ();
canvas.ExposeEvent += new ExposeEventHandler... etc,

even though this type of construction works for other events such as
BoundsChanged, MouseMoved, etc. Is this a deliberate design decision,
or could the facility be provided? I have a situation (in porting some
code from Gtk#) where adding an event handler in one class which
contains a local Canvas variable (as in the example above) is by far the
easiest approach.

Lluis Sanchez Gual

unread,
May 1, 2013, 6:30:46 AM5/1/13
to xwt-...@googlegroups.com
It was a deliberate design decision. If that's a big issue I could add it, although I would prefer not to.
> --
> You received this message because you are subscribed to the Google Groups "XWT Widget Toolkit" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to xwt-list+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Hywel Thomas

unread,
May 1, 2013, 6:50:38 AM5/1/13
to xwt-...@googlegroups.com
It's no real problem (there are a few ways around it, one of which is to
raise an event in OnDraw), but, digging a bit further, it would appear
that the ExposeEvent as such was removed in the change from Gtk2 to
Gtk3. I was just interested to know why the design decision had been
made. Thanks for your comments.

On 01/05/13 11:30, Lluis Sanchez Gual wrote:
> It was a deliberate design decision. If that's a big issue I could add it, although I would prefer not to.
>
> El 24/04/2013, a las 17:00, Hywel <hywel.w...@gmail.com> escribi�:
Reply all
Reply to author
Forward
0 new messages