Possible to list the gadgets children of a container gadget?

Just starting out? Need help? Post your questions and find answers here.
SkyManager
Enthusiast
Enthusiast
Posts: 339
Joined: Tue Jan 30, 2007 5:47 am
Location: Hong Kong

Possible to list the gadgets children of a container gadget?

Post by SkyManager »

hi all,

is it possible to list the gadgets children of a container gadget?

PB manual only tells us how to ADD.
Cannot LIST/VIEW?
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Possible to list the gadgets children of a container gad

Post by infratec »

If you add it, you know that it is there :wink:
If you need this information later, store it in a 'ContainerGadgetList()'

Bernd
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Possible to list the gadgets children of a container gad

Post by RSBasic »

Code: Select all

EnableExplicit

Define EventID

Procedure ListWindows(hwnd,Param)
  Protected String$
  Protected String2$
  
  String$ = Space(250)
  String2$ = Space(1024)
  GetWindowText_(hwnd,String$,250)
  GetClassName_(hwnd,@String2$,Len(String2$))
  
  Debug "Handle-Nummer des Gadgets: "+Str(hwnd)
  Debug "PureBasic-Nummer des Gadgets: "+Str(GetProp_(hwnd, "PB_ID"))
  Debug "Typ des Gadgets: "+String2$
  Debug "Inhalt des Gadgets: "+String$
  Debug "--------------------------------------------------------------------"
  
  ProcedureReturn #True
EndProcedure

If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  If ContainerGadget(0, 10, 10, 480, 380, #PB_Container_Flat)
    ButtonGadget(1,10,10,100,20,"Hallo Button",0)
    StringGadget(2,120,10,100,20,"Hallo Edit",0)
    ListViewGadget(3,10,40,100,100,0)
    CloseGadgetList()  
  EndIf
  
  EnumChildWindows_(GadgetID(0),@ListWindows(),0)
  
  Repeat
    EventID=WaitWindowEvent()
    If EventID = #PB_Event_CloseWindow
      End
    EndIf
  ForEver
EndIf
Image
Image
Post Reply