Package: gtk

Function gtk-notebook-tab-detachable

Lambda List

gtk-notebook-tab-detachable (notebook child)

Syntax

(gtk-notebook-tab-detachable notebook child) => detachable
(setf (gtk-notebook-tab-detachable notebook child) detachable)

Arguments

notebook -- a gtk-notebook widget
child -- a gtk-widget child page
detachable -- a boolean whether the tab is detachable or not

Details

Accessor of the detachable child property of the notebook.

The gtk-notebook-tab-detachable function returns whether the tab content can be detached from the notebook to another notebook or widget. The (setf gtk-notebook-tab-detachable) function sets whether the tab can be detached.

Note that two notebooks must share a common group identificator, see the gtk-notebook-group-name function, to allow automatic tabs interchange between them.

Example

If you want a widget to interact with a notebook through DnD, i.e. accept dragged tabs from it, it must be set as a drop destination and accept the "GTK_NOTEBOOK_TAB" target. The notebook will fill the selection with a GtkWidget** pointing to the child widget that corresponds to the dropped tab.
static void
on_drop_zone_drag_data_received (GtkWidget        *widget,
                                 GdkDragContext   *context,
                                 gint              x,
                                 gint              y,
                                 GtkSelectionData *selection_data,
                                 guint             info,
                                 guint             time,
                                 gpointer          user_data)
{
  GtkWidget *notebook;
  GtkWidget **child;

notebook = gtk_drag_get_source_widget (context); child = (void*) gtk_selection_data_get_data (selection_data);

process_widget (*child); gtk_container_remove (GTK_CONTAINER (notebook), *child); }
If you want a notebook to accept drags from other widgets, you will have to set your own DnD code to do it.
 

See also

2021-12-17