Hidden Widgets
- From: riboaz xs4all nl
- To: gtk-list gnome org
- Subject: Hidden Widgets
- Date: Sat, 23 Jul 2005 13:19:14 +0200 (CEST)
hi,
I'm having a problem, my hair is coming out in clumps, and they are very
related.
I have an application of several notebook tabs displaying various forms of
signal processing/analysis (seismological in nature). For each of these
screens I have created a group of two radio buttons representing the
filter for the signal being either ON or OFF. The internal program
variable representing this filter state is universal, i.e., if it's turned
on in one screen, then it will be turned on for all the screens.
What I want to do, then, is when the user sets this filter state in one
screen, I want to set the other filter radio groups to be of the same
state. The internal variable is working, however, when I try to effect
this "universality" for the other radio button groups, it simply does not
work.
What I'm doing:
- each screen has its own radio group for the filter ON/OFF state
- a single radio button within each has a callback function attached to
the "toggle" signal
- in this callback, after the data processing, I go to set all the other
filter radio groups to be of the same state, thus:
- block the signal attached to each radio button
- set the radio button to the proper state using
gtk_toggle_button_set_active()
- unblock the signal blocked above
What happens:
- nothing, only the radio button which has been changed by the mouse has
the new setting; it's as if the call to gtk_toggle_button_set_active() has
simply not been called.
Possible influences:
- all other radio groups I am attempting to set have been previously
hidden using gtk_widget_hide() (only the parent, not the radios
themselves), (suspecting this could be something, I tried setting the
radio group explicitly once gtk_widget_show() had been called on the
parent, but, again, to no effect (though i now realize that I did this
before the gtk_widget_show() event had been processed by gtk_main()).
What I've tried:
- experimenting and testing by setting the radio groups explicitly in the
callback using TRUE and FALSE, this test of explicitness also has no
effect.
What I've noticed:
- when I turn off the signal blocking, (in effect, then, calling the same
callback again since gtk_toggle_button_set_active() will emit the
"toggled" signal), only the radio button currently being "shown" results
in the "toggled" signal being emitted.
My questions, then:
1) Is there some implication of attempting to call
gtk_toggle_button_set_active() on a toggle button currently "hidden"? Are
all signals for hidden widgets internally blocked by gtk? Are the hidden
widgets simply not "addressable" by calls attempting to affect their
state?
2) Is this behaviour that is "as advertised", (btw, can't find that ad
anywhere), or have I hit upon some esoterica?
3) How exactly should one do this since the way I am attempting it does
not work?
Any input as to the cause and explanation of this (hopefully leading to a
solution), or, better yet, any pointers as to how to make it actually do
what I need to do would be greatly appreciated.
cheers,
richard boaz
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]