; Module/File: Panel_TabD&DReorderable.pb ; Function: Reorderable PanelGadget-tab by Drag & Drop - Linux gtk2/gtk3 ; Author: Omi ; Date: Aug. 23, 2014 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31/5.4/5.6 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- ; With gtk2 no label on dragged tabs appears? With gtk3 it's ok. EnableExplicit ImportC "" gtk_notebook_set_tab_reorderable(*notebook.GtkNotebook, *child.GtkWidget, reorderable) EndImport ; Object constants #Win_Main= 0 #Text1 = 0 #Panel1 = 1 Global.i gEvent, gQuit Global.i gI, gTabs= 4 Global *gWidget.GtkWidget If OpenWindow(#Win_Main, 0, 0, 410, 310, "PanelGadget: tab-pos by Drag&Drop", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) TextGadget(#Text1, 5, 5, 300, 20, "Change Tab-Position by Drag&Drop ...") PanelGadget(#Panel1, 0, 30, 400, 270) For gI= 0 To gTabs- 1 AddGadgetItem(#Panel1, -1, " Tab (Rider) "+Str(gI)) TextGadget(#PB_Any, 5, 5, 200, 20, "Panel "+Str(gI)) Next gI CloseGadgetList() gTabs= gtk_notebook_get_n_pages_(GadgetID(#Panel1)); Num of tabs For gI= 0 To gTabs- 1 *gWidget= gtk_notebook_get_nth_page_(GadgetID(#Panel1), gI); gtk_notebook_set_tab_reorderable(GadgetID(#Panel1), *gWidget, #True) Next gI Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True EndSelect Until gQuit EndIf End ; IDE Options = PureBasic 5.45 LTS (Linux - x86) ; CursorPosition = 7 ; EnableUnicode ; EnableXP ; CurrentDirectory = /home/charly-xubuntu/Programming/PureBasic/purebasic/