summaryrefslogtreecommitdiff
path: root/gtk2_ardour/option_editor.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-06-29 15:45:34 +0200
committerRobin Gareus <robin@gareus.org>2014-06-29 16:11:46 +0200
commit37a656b7b8e025bfa861f23ce9e8393bfc745e61 (patch)
treed7b2e7a02291fd984ddd7224cd35be0c15e3316b /gtk2_ardour/option_editor.h
parent8df35b35ba8cbc7e662f867e47325e2af5cf9262 (diff)
add a generic Option Editor Component for stateless widgets
Diffstat (limited to 'gtk2_ardour/option_editor.h')
-rw-r--r--gtk2_ardour/option_editor.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h
index c4ab78e19b..f42d1da9b7 100644
--- a/gtk2_ardour/option_editor.h
+++ b/gtk2_ardour/option_editor.h
@@ -181,6 +181,23 @@ private:
Gtk::Label* _label; ///< label for button, so we can use markup
};
+/** Component which allows to add any GTK Widget - intended for single buttons and custom stateless objects */
+class FooOption : public OptionEditorComponent
+{
+public:
+ FooOption (Gtk::Widget *w) : _w (w) {}
+
+ void add_to_page (OptionEditorPage* p) {
+ add_widget_to_page (p, _w);
+ }
+
+ Gtk::Widget& tip_widget() { return *_w; }
+ void set_state_from_config () {}
+ void parameter_changed (std::string const &) {}
+private:
+ Gtk::Widget *_w;
+};
+
/** Component which provides the UI to handle a string option using a GTK Entry */
class EntryOption : public Option
{