DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2026
Version: 1.3-current


Fabien, I've been in a hurry yesterday, therefore I'll add now:

- The indentation changes in the OP's patch were really wrong, not only
unnecessary, so you would better start off with my patch version, or you
would have to fix the indentation by hand.

- When I recently looked at this patch, I was not sure if it was okay at
all. IMHO, the when() conditions for buttons are not well (sufficiently)
defined, so that it may be difficult to decide, how they should work.

I think that we should think about defining the button when() conditions
better, before trying to "fix" something that is maybe undefined behavior.

The FLTK 1.1 docs [1] only define the behavior for some "useful" when()
conditions:

"Controls when callbacks are done. The following values are useful, the
default value is FL_WHEN_RELEASE:

    * 0: The callback is not done, instead changed() is turned on.
    * FL_WHEN_RELEASE: The callback is done after the user successfully
clicks the button, or when a shortcut is typed.
    * FL_WHEN_CHANGED : The callback is done each time the value() changes
(when the user pushes and releases the button, and as the mouse is dragged
around in and out of the button).

If I read this correctly, the OP's problem is moot, because
FL_WHEN_CHANGED is not defined to trigger the callback (it is not
mentioned there, but is mentioned explicitly for FL_WHEN_RELEASE.

Now my conclusion: Since the when() condition is a bit field, the correct
solution would be to leave the code as it is (unless you find real bugs)
and use the solution to set the button to
when(FL_WHEN_CHANGED|FL_WHEN_RELEASE) to achieve what the OP wanted.

This should make the code much easier ... (I hope).

Thoughts?
-----
[1] http://www.fltk.org/doc-1.1/Fl_Button.html#Fl_Button.when


Link: http://www.fltk.org/str.php?L2026
Version: 1.3-current

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to