[gtkmm] Glade::VariablesMap voes



Hi!

I'm having a problem with Glade::VariablesMap. I basically have the following code:

bool radio1;
bool radio2;
bool radio3;

...

varMap->connect_widget("radio1", radio1);
varMap->connect_widget("radio2", radio2);
varMap->connect_widget("radio3", radio3);

...

std::cout << "before: radio1=" << radio1 << std::endl;
std::cout << "before: radio2=" << radio2 << std::endl;
std::cout << "before: radio3=" << radio3 << std::endl;
varMap->transfer_variables_to_widgets();
std::cout << "after: radio1=" << radio1 << std::endl;
std::cout << "after: radio2=" << radio2 << std::endl;
std::cout << "after: radio3=" << radio3 << std::endl;

If you didn't guess it already, radio[1-3] are Gtk::RadioButton's, that all belong to the same radio group.
When I run the program, I get the following output:

before: radio1=0
before: radio2=0
before: radio3=1
after: radio1=1
after: radio2=0
after: radio3=0

Pretty weird, me thinks. The actual visuals are put into the incorrect/unexpected state. I should add that varMap->transfer_widgets_to_variables() works perfectly and puts exactly the current state of the radio buttons into radio[1-3], so the variable mapping per se appears to work correctly. It also seems to map a whole bunch of other widgets correctly. In fact, only one specific radio button has this problem. I should also add that the particular radio button in question is, together with a few other widgets, also a member of another VariablesMap.

What's going on?

--
Christer Palm




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]