Re: GtkButtons and RUN_FIRST/RUN_LAST
- From: Joel Becker <jlbec evilplan org>
- To: Owen Taylor <otaylor redhat com>
- Cc: gtk-devel-list gnome org
- Subject: Re: GtkButtons and RUN_FIRST/RUN_LAST
- Date: Fri, 26 Oct 2001 22:48:02 +0100
On Fri, Oct 26, 2001 at 05:30:50PM -0400, Owen Taylor wrote:
> OK, two comments here:
>
> - The new ::clicked semantic is _exactly_ designed to make doing
> this type of thing easy. Instead of setting things back
> you can do your own thing and simply stop_emit.
Ok, that makes sense. I saw the stop_emit thing. But I still
think folks are going to naively see the state as a foregone conclusion.
Never mind the trace you see on a toggle button:
user_clicked(a)
default_clicked(a)
default_toggled(a)
user_toggled(a)
So what yosh sees in a one-click-exit radio setup is:
user_clicked(a)
{
gtk_main_quit();
}
default_clicked(a)
{
set_state();
default_toggeld(a);
user_toggled(a)
{
update_my_result_var(a);
}
}
What he wanted was "when clicked, set my variable to the selected item,
then exit". What he gets is "Start the exit, but as the signal unwinds
my variable gets set anyway". Right behavior, kinda screwey semantic.
I have the feeling someone will get bitten by this out-of-order run.
> - You do know about gtk_toggle_button_set_mode, right? If
> draw_indicator is FALSE, check buttons and radio buttons
> look just like buttons.
I did not know about this. I went looking, didn't see it, and
did my own. Maybe this will solve my problem. Gonna try it.
Joel
--
"The opposite of a correct statement is a false statement. The
opposite of a profound truth may well be another profound truth."
- Niels Bohr
http://www.jlbec.org/
jlbec evilplan org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]