Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // main_grid
- tgrid* main_grid = dynamic_cast<tgrid*>(pref_node.find("pref_main_grid", true));
- // THIS WORKS
- tlabel& value_label = find_widget<tlabel>(main_grid, "value", false);
- // NEXT USECASE
- setup_single_toggle("value_toggle"
- , preferences::get(option["field"], option["default"].to_bool())
- , boost::bind(set_ptr, option["field"].str(), _1)
- , main_grid);
- // DEFINITION OF ABOVE
- template <typename T>
- void tpreferences::setup_single_toggle(
- const std::string& widget_id
- , const bool start_value
- , boost::function<void(bool)> callback
- , T& window)
- {
- ttoggle_button& widget =
- find_widget<ttoggle_button>(&window, widget_id, false);
- widget.set_value(start_value);
- connect_signal_mouse_left_click(widget, boost::bind(
- &tpreferences::single_toggle_callback<T>
- , this, widget_id
- , callback, boost::ref(window)));
- }
- // ERROR
- C:\Users\\Documents\wesnoth-git\src\gui\dialogs\preferences_dialog.cpp|165|error: no matching function for call to 'find_widget(gui2::tgrid**, const string&, bool)'|
Advertisement
Add Comment
Please, Sign In to add comment