I have noticed that I was not able to capture any events from a Xwt.HPaned when I used the mouse to drag the position to the left and right. I'm not sure if this is intentional, or if this is consistent with how WPF and Mac handles things, but I have managed to find a way to get this event sent in the Xwt.PanedBackend for Gtk.
I'm not sure if what have done is appropriate for what is intended to be implemented, of if I have done this in the most elegant way, so I thought I'd it through here first to see what everyone thought. Here is what i have added into the Gtk Xwt.PanedBackend.cs file:
+ int formerPosition;
+ void HandleWidgetEvent (object o, Gtk.WidgetEventArgs args)
+ {
+ if (formerPosition != (o as Gtk.Paned).Position) {
+ EventSink.OnPositionChanged();
+ formerPosition = (o as Gtk.Paned).Position;
+ }
+ }
public void Initialize (Orientation dir)
{
if (dir == Orientation.Horizontal)
Widget = new Gtk.HPaned ();
else
Widget = new Gtk.VPaned ();
Widget.Show ();
+ Widget.WidgetEvent += HandleWidgetEvent;
}
Basically, I found that you must trap every event, then check if the position has changed or not. If the position has changed, I send off an event to the EventSink...
One problem I have found, is that the event will get raised even for the initial setting of the widget, not just a user created event... again, not sure how the Mac and WPF implementation works, so not sure if this is a problem or not...
Let me know what you all think, and if this is okay I will try to figure out how to submit changes to GitHub. (never done that before)