Question about a ListViewGadget

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

Hi !
in the first sourcecode i can see my ListViewGadget. Why not in the 2nd one ?

MFG
WolfgangS

Code: Select all

#ID_MWindow=0#ID_MPanel=1
#ID_Webgadget=2
#ID_LVGadget=3

hnd_MWindow=OpenWindow(#ID_MWindow,100,100,640,480,#PB_Window_SystemMenu,"Bla")
Structure WazUp
  str_PAN.s
EndStructure
NewList panel.WazUp()

If CreateGadgetList(WindowID())                                                            ; Create GadgetList
  ListViewGadget(#ID_LVGadget,0,396,640,84)                                                ; Create ListView Gadget
  AddGadgetItem(#ID_LVGadget,LVAmount,"Welcome to XXX"):LVAmount+1                         ;    Add ListView Item

  PanelGadget(#ID_MPanel,0,28,640,365)                                                     ; Create Panel Gadget
  AddElement(Panel()) : PanelAmount+1 : Panel()\str_PAN="Info"                             ;    Add Panel Gadget
  AddGadgetItem(#ID_MPanel,-1,"Info") : WebGadget(#ID_WebGadget,0,0,635,340,"info.html")   ;    Add Web   Gadget 

Else : End
EndIf


Repeat
  Event=WaitWindowEvent()
Until Event=#PB_EventCloseWindow

Code: Select all

#ID_MWindow=0
#ID_MPanel=1
#ID_Webgadget=2
#ID_LVGadget=3

hnd_MWindow=OpenWindow(#ID_MWindow,100,100,640,480,#PB_Window_SystemMenu,"Bla")
Structure WazUp
  str_PAN.s
EndStructure
NewList panel.WazUp()

If CreateGadgetList(WindowID())                                                            ; Create GadgetList
  PanelGadget(#ID_MPanel,0,28,640,365)                                                     ; Create Panel Gadget
  AddElement(Panel()) : PanelAmount+1 : Panel()\str_PAN="Info"                             ;    Add Panel Gadget
  AddGadgetItem(#ID_MPanel,-1,"Info") : WebGadget(#ID_WebGadget,0,0,635,340,"info.html")   ;    Add Web   Gadget 

  ListViewGadget(#ID_LVGadget,0,396,640,84)                                                ; Create ListView Gadget
  AddGadgetItem(#ID_LVGadget,LVAmount,"Welcome to XXX"):LVAmount+1                         ;    Add ListView Item

Else : End
EndIf


Repeat
  Event=WaitWindowEvent()
Until Event=#PB_EventCloseWindow
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Probably because in the second example you don't close off your panel gadget properly. You should add ClosePanelGadget() before you draw your next gadget which is ListViewGadget.

In the first example you don't draw any gadgets after you are finished with the Panel Gadget so the compiler is most likely being very forgiving to you :)

Visit the PB Resources Site at http://www.reelmediaproductions.com/pb
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

Hi!
thanks for the info ...


MFG
WolfgangS
Post Reply