[PB 4.10B4] Macro/With combination
Posted: Wed Oct 10, 2007 11:25 am
Code: Select all
;{ Macros
Macro DQuote
"
EndMacro
Macro ListView_Add(Flag)
Item.l = CountGadgetItems(0)
AddGadgetItem(0, Item, DQuote#Flag#DQuote)
If \ID = #True : SetGadgetItemState(#Main_ListView_0, Item, #True) : EndIf
EndMacro
;}
;{ Structures
Structure Test
ID.l
EndStructure
;}
Global *Infos.Test
*Infos\ID = #True
If OpenWindow(0,0,0,270,140,"ListViewGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ListViewGadget(0,10,10,250,120)
For a=1 To 12
With *Infos
ListView_Add(a)
EndWith
Next
SetGadgetState(0,9)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf