FileChooserExtra(int init_x, int init_y) { Gtk::Label *lbl; resize = Gtk::manage(new Gtk::CheckButton("Save options (requires re-render)")); resize->set_active(false); pack_start(*resize); resize->signal_toggled().connect(sigc::mem_fun(*this, &FileChooserExtra::do_toggle)); inner = Gtk::manage(new Gtk::HBox()); lbl = Gtk::manage(new Gtk::Label("X resolution", 0.9, 0.5)); inner->pack_start(*lbl); f_x = Gtk::manage(new Util::HandyEntry<int>()); f_x->set_activates_default(true); inner->pack_start(*f_x); lbl = Gtk::manage(new Gtk::Label("Y resolution", 0.9, 0.5)); inner->pack_start(*lbl); f_y = Gtk::manage(new Util::HandyEntry<int>()); f_y->set_activates_default(true); inner->pack_start(*f_y); antialias = Gtk::manage(new Gtk::CheckButton("Antialias")); antialias->set_active(false); inner->pack_start(*antialias); do_hud = Gtk::manage(new Gtk::CheckButton("Render HUD")); do_hud->set_active(false); inner->pack_start(*do_hud); f_x->update(init_x); f_y->update(init_y); pack_start(*inner); show_all(); resize->show(); inner->hide(); }
void do_toggle() { if (resize->get_active()) inner->show(); else inner->hide(); }