Community
Participate
Working Groups
The body of this method contains only checkWidget() call and FIXME commentary.
Could follow Motif and implement it using gdk_pointer_grab(), although it seems bug 19430 takes issue with its implementation. Also note that grabs are scary and you really want to avoid doing. Maybe there's a better way to get the functionality you need without using setCapture()? If possible, can you give more motivation (or a snippet)?
We should do the same thing we do for Motif (ie. use gdk_pointer_grab() or the equivalent call).
I'm not sure there is any reason to "fixme" if the contract can't be met. Perhaps change the API to say something like "causes the receiver to have all _future_ mouse events" (as in events that are not currently hanging around in the event queue). Or say that it has no effect on pending mouse events that haven't been dispatched.
Do you know this to be a fact?
This seems to be the issue with bug 19430. The snippet there shows at least one mouse event that gets dispatched to a non-captured control after capture is requested. I'm guessing that this is because it was queued before mouseCapture happened.
Back to the motivation: 1) We need a consistenet API across all platforms (I think it's enought ;-). 2) In our application we need avoid user to leave text fields with not valid values. These values should be written back to the model after widget lose the focus.
> 2) In our application we need avoid user to leave text fields with not valid > values. These values should be written back to the model after widget lose the > focus. There are lots of other ways to do this without mouse capture. Look at how celleditors in the propertysheet work, or how wizards disable the Finish button and display an error in the dialog. To do what you are suggesting would require additional hacking like adding Traverse listeners.
(In reply to comment #7) > There are lots of other ways to do this without mouse capture. Look at how > celleditors in the propertysheet work, or how wizards disable the Finish button > and display an error in the dialog. There is no finish/apply button or something like this, the value (if valid) must be written back to the model if: 1) enter is pressed (No problem with check here) 2) Control loses focus. But if the value isn't valid the requirement is to avoid user to leave this field. The error message as in the CellEditors is no solution for us. > > To do what you are suggesting would require additional hacking like adding > Traverse listeners. That's what we already did + setCapture()
Checking the source code tells me that this is till an issue. Assigning to platform inbox for more discussion.
This doesn't appear to be implemented on Mac either.