{
dragging = false;
_visible = true;
+ _can_be_torn_off = true;
tearoff_event_box.add (tearoff_arrow);
tearoff_event_box.set_events (BUTTON_PRESS_MASK|BUTTON_RELEASE_MASK);
VBox* box1;
box1 = manage (new VBox);
- box1->pack_start (close_event_box, false, false, 5);
+ box1->pack_start (close_event_box, false, false, 2);
window_box.pack_end (*box1, false, false, 2);
own_window.add (window_box);
VBox* box2;
box2 = manage (new VBox);
- box2->pack_start (tearoff_event_box, false, false, 5);
+ box2->pack_start (tearoff_event_box, false, false, 2);
pack_start (contents);
pack_start (*box2, false, false, 2);
{
}
+void
+TearOff::set_can_be_torn_off (bool yn)
+{
+ if (yn != _can_be_torn_off) {
+ if (yn) {
+ tearoff_arrow.set_no_show_all (false);
+ tearoff_arrow.show ();
+ } else {
+ tearoff_arrow.set_no_show_all (true);
+ tearoff_arrow.hide ();
+ }
+ _can_be_torn_off = yn;
+ }
+}
+
void
TearOff::set_visible (bool yn)
{
gint
TearOff::tearoff_click (GdkEventButton* ev)
{
- remove (contents);
- window_box.pack_start (contents);
- own_window.set_name (get_name());
- close_event_box.set_name (get_name());
- own_window.show_all ();
- hide ();
- Detach ();
+ if (_can_be_torn_off) {
+ remove (contents);
+ window_box.pack_start (contents);
+ own_window.set_name (get_name());
+ close_event_box.set_name (get_name());
+ own_window.show_all ();
+ hide ();
+ Detach ();
+ }
+
return true;
}