[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XForms] setting radio button invokes callback
From: |
Jens Thoms Toerring |
Subject: |
Re: [XForms] setting radio button invokes callback |
Date: |
Sat, 4 Dec 2010 17:50:57 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hi Michal,
On Sat, Dec 04, 2010 at 05:24:00AM +0100, Michal Szymanski wrote:
> While investigating strange duplication of some activities of my
> application I found that, if one programatically (from within the
> application) sets a radio button, its callback is invoked (unless it is
> already set). This is contrary to the common sense and (more importantly :)
> to the manual (here, see second paragraph, first is discussed below):
>
> == Sect. 16.4: Other Button Routines: ==
>
> To this end use the routine
> void fl_set_button(FL_OBJECT *obj, int pushed);
> pushed indicates whether the button should be pushed (1) or
> released (0). When setting a [FL_RADIO_BUTTON], page 117 to be pushed
> this automatically releases the currently pushed radio button in the
> same form (or group).
>
> Also note that, while this routine only simulates the visual appearance
> and perhaps some internal states, it does not affect the program flow in
> any way, i.e. setting a button as being pushed does not invoke its
> callback or results in the button becoming returned to the program.
>
> I was able to reproduce this behavior in a very simple program (attached
> below). Both in 1.0.93sp1 and 1.0.94sp2. This looks like a real bug to
> me.
Oops, you're absolutely right! That's definitely a bug. I hope I
was able to fix it and will upload a new pre-release when I had
time to address two other, unrelated issues (hopefully sometime
this weekend).
> Also, the manual is somewhat self-inconsistent on the matters regarding
> setting the radio buttons from within the application:
>
> == Sect. 3.4: Buttons ==
> The application program can also set a button to be pushed or not itself
> without a user action. (This is of course only useful for push buttons
> and radio buttons. Setting a radio button does not mean that the
> currently set radio button is reset. The application program has to do
> this.)
> ==
>
> which seems to be contrary to what first paragraph of above cited sect.
> 16.4 says (and what seems to be true - other buttons do get "unset" when
> one uses fl_set_button()
Also true. I have that changed to
The application program can also set a button to appear
pushed or not without user action. This is of course only useful
for push buttons and radio buttons. To set or reset a push or radio
button use the routine
void fl_set_button(FL_OBJECT *obj, int pushed);
pushed indicates whether the button should appear to be pushed
(1) or released (0). Note that this does not invoke a callback
routine bound to the button or results in the button getting
returned to the program, i.e.@: only the visual appearance
of the button is changed and what it returns when asked for its
state (and, in the case of a radio button, possibly that of another
radio button in the same group). To also get the callback invoked or
the button returned to the program additonally call e.g. fl_trigger_object().
Do you think that's clearer?
Thanks a lot and best regards, Jens
--
\ Jens Thoms Toerring ________ address@hidden
\_______________________________ http://toerring.de