Hi Assari,
Excellent series of tutorials.
I had trouble with this code in Tutorial 9...
unless I changed it to...
In the first example, after adding an icon flag, I got a default icon (rather than no icon if the path was wrong) unless I changed the code around.
Excellent series of tutorials.
I had trouble with this code in Tutorial 9...
SuperStrict Local MyWindow:TGadget=CreateWindow("ListBox Example", 200,200,320,240) Local ListBox:TGadget=CreateListBox(10,10,200,100,MyWindow) For Local i:Int=1000 To 1050 AddGadgetItem ListBox,i Next Local IconStrip:TIconStrip=LoadIconStrip("toolbar.bmp") SetGadgetIconStrip(ListBox, IconStrip) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETACTION Local i:Int=SelectedGadgetItem(listbox) Local text:String=GadgetItemText(ListBox,i) Local flag:Int=GadgetItemFlags(ListBox,i) Local icon:Int=GadgetItemIcon(ListBox,i) icon=icon+1 If icon>11 icon=0 ModifyGadgetItem ListBox, i, text, flag, icon End Select Forever
unless I changed it to...
SuperStrict Local MyWindow:TGadget=CreateWindow("ListBox Example", 200,200,320,240) Local ListBox:TGadget=CreateListBox(10,10,200,100,MyWindow) Local IconStrip:TIconStrip=LoadIconStrip("toolbar.bmp") SetGadgetIconStrip(ListBox, IconStrip) For Local i:Int=1000 To 1050 AddGadgetItem ListBox,i,0,Rand(0,11) Next Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETACTION Local i:Int=SelectedGadgetItem(listbox) Local text:String=GadgetItemText(ListBox,i) Local flag:Int=GadgetItemFlags(ListBox,i) Local icon:Int=GadgetItemIcon(ListBox,i) icon=icon+1 If icon>11 icon=0 ModifyGadgetItem ListBox, i, text, flag, icon End Select Forever
In the first example, after adding an icon flag, I got a default icon (rather than no icon if the path was wrong) unless I changed the code around.