ScrollAreaGadget - referring to it after CloseGadgetList

Just starting out? Need help? Post your questions and find answers here.
itzybitzyspider
Posts: 27
Joined: Tue Nov 22, 2022 4:36 am

ScrollAreaGadget - referring to it after CloseGadgetList

Post by itzybitzyspider »

Hi,

Code: Select all

    ScrollAreaGadget(#ContainerMenu, 160, 35, ScreenWidth - 170, ScreenHeight - 100, ScreenWidth-190, ScreenHeight - 120, 10) 
      
    CloseGadgetList()
I've got the above code, where ScreenWidth and ScreenHeight is defined with DesktopWidth and DesktopHeight accordingly.

After this definition, I want to ADD a button or string gadget.

How would I reference this #ContainerMenu and place another gadget dynamically? Same with a Window... how do I reference an existing window and add a button or another gadget.
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: ScrollAreaGadget - referring to it after CloseGadgetList

Post by Peter »

After this definition, I want to ADD a button or string gadget.
you can do this with OpenGadgetList():

Code: Select all

Enumeration
  #Window
  #ScrollAreaGadget
  #ButtonGadget
EndEnumeration

OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 305, 140, "ScrollAreaGadget", #PB_Window_ScreenCentered)
ScrollAreaGadget(#ScrollAreaGadget, 10, 10, 290,120, 375, 155, 30)
CloseGadgetList()


OpenGadgetList(#ScrollAreaGadget)
ButtonGadget(#ButtonGadget, 10, 10, 230, 30,"Button 1")
CloseGadgetList()
Same with a Window...
-> UseGadgetList()
itzybitzyspider
Posts: 27
Joined: Tue Nov 22, 2022 4:36 am

Re: ScrollAreaGadget - referring to it after CloseGadgetList

Post by itzybitzyspider »

Ah thanks.
Post Reply