Hi,
The question is easy...
How can i reorder panelgadget items like this Windows code (http://www.purebasic.fr/english/viewtopic.php?t=28479) ?
Thank you...
Reorder PanelGadget Items
this is a little tricky as you dont have the ID's from the panel tabs when you use AddGadgetItem()
Here is a small example how to reorder the tabs... one bad thing... you can't use PB Gadgets on this panel as you don't have the tabs in the gadgetlist.... you must use gtk widgets instead... (if someone could tell how to get the id's from each tab from the panelgadget..... if possible at all....*looking at fred*
)
Here is a small example how to reorder the tabs... one bad thing... you can't use PB Gadgets on this panel as you don't have the tabs in the gadgetlist.... you must use gtk widgets instead... (if someone could tell how to get the id's from each tab from the panelgadget..... if possible at all....*looking at fred*
Code: Select all
If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
*nb1= PanelGadget (#PB_Any, 5, 5, 290, 166)
*notebook1=GadgetID(*nb1)
*empty_notebook_page0 = gtk_vbox_new_(#False, 0);
gtk_widget_show_(*empty_notebook_page0);
gtk_container_add_(*notebook1, *empty_notebook_page0);
*label1 = gtk_label_new_("label1");
gtk_widget_show_(*label1);
gtk_notebook_set_tab_label_(*notebook1, gtk_notebook_get_nth_page_(*notebook1 , 0), *label1);
*empty_notebook_page1 = gtk_vbox_new_(#False, 0);
gtk_widget_show_(*empty_notebook_page1);
gtk_container_add_(*notebook1, *empty_notebook_page1);
*label2 = gtk_label_new_("label2");
gtk_widget_show_(*label2);
gtk_notebook_set_tab_label_(*notebook1, gtk_notebook_get_nth_page_(*notebook1 , 1), *label2);
;this is the part where you can reorder the tabs.... the last parameter is the new position or -1 = moved to the end
gtk_notebook_reorder_child_(*notebook1,*empty_notebook_page1,0)
SetGadgetState(*nb1,0) ; to activate the first tab again
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Code: Select all
gtk_widget_set_parent_(*widget,*parent_widget)
Code: Select all
gtk_widget_set_parent_window_(*widget,*parent_window)


