; Module/File: Panel_SetTabOrderByValue.pb ; Function: Set PanelGadget-tab by (code)-value - 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 ;-------------------------------------------------------------- EnableExplicit ; Object constants #Win_Main= 0 #Text1 = 0 #SG1 = 1 #Panel1 = 2 Global.i gEvent, gQuit Global.i gI Global *gWidget.GtkWidget If OpenWindow(#Win_Main, 0, 0, 410, 310, "PanelGadget: set taborder by value", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) TextGadget(#Text1, 5, 7, 150, 20, "Set 'Tab 0'-position: ") SpinGadget(#SG1, 125, 2, 100, 25, 0, 3, #PB_Spin_Numeric);#PB_Spin_ReadOnly) SetGadgetState(#SG1, 0) PanelGadget(#Panel1, 0, 30, 400, 270) For gI=0 To 3 AddGadgetItem(#Panel1, -1, " Tab (Rider) "+Str(gI)) TextGadget(#PB_Any, 5, 5, 200, 20, "Panel "+Str(gI)) Next gI CloseGadgetList() *gWidget= gtk_notebook_get_nth_page_(GadgetID(#Panel1), 0) Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True Case #PB_Event_Gadget If EventGadget()= #SG1 gtk_notebook_reorder_child_(GadgetID(#Panel1), *gWidget, GetGadgetState(#SG1)) EndIf EndSelect Until gQuit EndIf End ; IDE Options = PureBasic 5.45 LTS (Linux - x86) ; CursorPosition = 8 ; EnableUnicode ; EnableXP ; CurrentDirectory = /home/charly-xubuntu/Programming/PureBasic/purebasic/