summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext/tabbable.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-07-25 08:41:26 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-02-22 15:31:23 -0500
commitd4664434f78770525d333d58a4d4e8bbd2abce94 (patch)
tree5320c1ffc2cf5fb31b061548e5611bb3ff00e87d /libs/gtkmm2ext/tabbable.cc
parent5e0337a4a34ba8e37245cf4b7eaece2b93c553a1 (diff)
set "close-button" data on Tabbable contents.
I tried doing this in the constructor and got a segfault for reasons I don't understand but probably should
Diffstat (limited to 'libs/gtkmm2ext/tabbable.cc')
-rw-r--r--libs/gtkmm2ext/tabbable.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/gtkmm2ext/tabbable.cc b/libs/gtkmm2ext/tabbable.cc
index fe1a27285a..720c9df9ca 100644
--- a/libs/gtkmm2ext/tabbable.cc
+++ b/libs/gtkmm2ext/tabbable.cc
@@ -41,11 +41,12 @@ Tabbable::Tabbable (Widget& w, const string& name)
{
/* sizes will be scaled during rendering */
tab_close_image.set_size_request (15,15);
-
+
+ _tab_box.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
_tab_box.set_spacing (2);
_tab_box.pack_start (_tab_label, true, true);
_tab_box.pack_start (tab_close_image, false, false);
-
+
tab_close_image.signal_button_release_event().connect (sigc::mem_fun (*this, &Tabbable::tab_close_clicked));
}
@@ -243,6 +244,7 @@ Tabbable::attach ()
}
_parent_notebook->append_page (_contents, _tab_box);
+ _contents.set_data ("close-button", &tab_close_image);
_parent_notebook->set_tab_detachable (_contents);
_parent_notebook->set_tab_reorderable (_contents);
_parent_notebook->set_current_page (_parent_notebook->page_num (_contents));