Code: Alles auswählen
EnableExplicit
Procedure MoveGadget(gadget, target_windowid)
! var GadgetElement = $(spider_GadgetID(v_gadget).div);
! GadgetElement.appendTo(v_target_windowid.content);
EndProcedure
;================================================== Beispielcode ==================================================
Procedure GadgetEvent()
Select EventGadget()
Case 2
MoveGadget(1, WindowID(1))
Case 3
MoveGadget(1, WindowID(0))
EndSelect
EndProcedure
If OpenWindow(0, 100, 100, 300, 200, "Window 1")
ButtonGadget(1, 10, 10, 100, 20, "Button 007", 0)
ButtonGadget(2, 120, 10, 150, 20, "Move button 007 >>", 0)
ButtonGadget(3, 120, 40, 150, 20, "<< Move button 007", 0)
BindEvent(#PB_Event_Gadget, @GadgetEvent())
EndIf
If OpenWindow(1, 500, 100, 300, 200, "Window 2")
EndIf