[gtkmm] Internationalized Gtk::Combo



Could anybody give me an advice or a pointer to a tutorial/document that
deals with internationalizing a Gtk::Combo? My problem is as follows: I
am creating a combo box with a few choices, say "foo" and "bar". Upon
receiving the change signal I would like to retrieve the selected item
and based on it retrieve an object from an std::map<std::string>. 

The trouble is that the map is build using "foo" and "bar", but the
combo box is built using _("foo") and _("bar"), which most of the time
is far from "foo" and "bar". I have no choice how the map is built. 

Is there a way to associate a, say, action command with each item of the
combo box and then retrieve the selected item and its command? The
tutorial or the Doxygen docs did not provide immediate answers ...

To be more exact ... I am looking for something like this:

void Window::on_combo_changed() {
    Gtk::ComboDropDownItem item = ....
    std::string command = item ....

    x = map[command];
    // etc., and so on
}

Possible? And if yes, how? Also, is it described anywhere? Thanks in
advance!

Bo



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