# To subscribers of the xforms list from Mike Heffner <mheffner@vt.edu> :
On 30-May-2003 Angus Leeming wrote:
| On Saturday 24 May 2003 3:45 pm, Mike Heffner wrote:
|> On 04-May-2003 Angus Leeming wrote:
|> | - clicked = (clicked || xev->type == ButtonPress);
|> | + clicked = (clicked || xev->type == ButtonPress || xev->type ==
|> | MotionNotify
|>
|> Looking at this code again, when you click the mouse on any item in the
|> Browser, the callback (select_cb) will always be called with the event
|> type MotionNotify. I put a single printf at the top of that function
|> and I
|> never got a ButtonPress event. Possibly the MotionNotify events
|> are happening so quickly they hide the ButtonPress events read from
|> fl_last_event? Is anyone using fl_last_event() to read ButtonPress
|> events?
|> The file selector appears to be the only code in the entire xforms lib
|> that uses it.
|>
|> So, currently testing for MotionNotify in the select_cb is all I can
|> think
|> of.
|
| Mike, it strikes me that the logic of the above line is entirely wrong.
| clicked is changed if any random XEvent is passed but it should respond
| only
| to ButtonPress events. Shouldn't it be:
|
| - clicked = (clicked || xev->type == ButtonPress);
| + if (xev->type == ButtonPress) clicked = 1;
|
Yes, you could rewrite the line as that. However, it doesn't change the
logic at all -- if clicked starts off as false, then the only time it will
get set to true is when xev->type == ButtonPress, which is what your
version is doing. It will remain true in all other cases.
However, we still have the same problem that the callback is never getting
a ButtonPress event. ;-(
This weekend I'll try rewriting the file selector's callback using the
fl_set_browser_dblclick_callback(). It seems that might be a much easier
way of approaching this.
Mike
-- Mike Heffner <mheffner@[acm.]vt.edu> <mikeh@FreeBSD.org>_________________________________________________ To unsubscribe, send the message "unsubscribe" to xforms-request@bob.usuhs.mil or see http://bob.usuhs.mil/mailserv/xforms.html XForms Home Page: http://world.std.com/~xforms List Archive: http://bob.usuhs.mil/mailserv/list-archives/ Development: http://savannah.nongnu.org/files/?group=xforms
This archive was generated by hypermail 2b29 : Fri May 30 2003 - 11:24:25 EDT