diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-03-22 17:03:00 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-03-22 17:03:00 +0000 |
commit | 3aa346b253d515c3d0715ec5e0fa8b6ad477c4e5 (patch) | |
tree | a41d4380ad270324a2d05cbbab0d1e57dce2bdfe /libs/gtkmm2ext/choice.cc | |
parent | 004a49b0c7051a4d0f8972b0aff0ef8fa9cab03d (diff) |
significant changes in code to handle import/embedding - much cleaner and less code, plus the import progress bar now works; unify response handling for Gtkmm2ext::Choice
git-svn-id: svn://localhost/trunk/ardour2@415 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2ext/choice.cc')
-rw-r--r-- | libs/gtkmm2ext/choice.cc | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/libs/gtkmm2ext/choice.cc b/libs/gtkmm2ext/choice.cc index d1de376312..d00d75d38b 100644 --- a/libs/gtkmm2ext/choice.cc +++ b/libs/gtkmm2ext/choice.cc @@ -26,28 +26,30 @@ using namespace Gtkmm2ext; using namespace sigc; using namespace Gtk; -Choice::Choice (string prompt, vector<string> choices) +Choice::Choice (string prompt, vector<string> choices, bool center) { int n; vector<string>::iterator i; + + if (center) { + set_position (Gtk::WIN_POS_CENTER); + } else { + set_position (Gtk::WIN_POS_MOUSE); + } - set_position (Gtk::WIN_POS_CENTER); set_name ("ChoiceWindow"); Label* label = manage (new Label (prompt)); label->show (); + get_vbox()->set_border_width (12); get_vbox()->pack_start (*label); - for (n = 0, i = choices.begin(); i != choices.end(); ++i, ++n) { + set_has_separator (false); - Button* button; - - button = add_button (*i, RESPONSE_ACCEPT); - button->signal_button_release_event().connect (bind (mem_fun (*this, &Choice::choice_made), n), false); + for (n = 0, i = choices.begin(); i != choices.end(); ++i, ++n) { + add_button (*i, n); } - - which_choice = -1; } void @@ -60,17 +62,3 @@ Choice::on_realize () Choice::~Choice () { } - -bool -Choice::choice_made (GdkEventButton* ev, int nbutton) -{ - which_choice = nbutton; - response (RESPONSE_ACCEPT); - return true; -} - -int -Choice::get_choice () -{ - return which_choice; -} |