Code: Select all
Global homepage.s,pic1,pic2,aSound,testlisticongadget
;homepage="https://doko-lounge.de/"
homepage=""
Declare LoadingError(Type, Filename$)
Declare Loading(Type, Filename$, ObjectId)
; Register the loading event before calling any resource load command
BindEvent(#PB_Event_Loading, @Loading())
BindEvent(#PB_Event_LoadingError, @LoadingError())
InitSound()
OpenWindow(0,10,100,800,600,"TestWindow")
testlisticongadget=ListIconGadget(#PB_Any, 10,100, 290, 90, "picture", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
aSound=LoadSound(#PB_Any, homepage+"sound.wav")
pic1=LoadImage(#PB_Any, homepage+"freuen.png")
Procedure Loading(Type, Filename$, ObjectId)
Debug Filename$ + " loaded (id = " + ObjectId + ")"
If Filename$=homepage+"freuen.png"
AddGadgetItem(testlisticongadget, 1, "Picture 1", ImageID(pic1))
ImageGadget(#PB_Any,10,10,ImageWidth(pic1),ImageHeight(pic1),ImageID(pic1))
ButtonImageGadget(#PB_Any,10,50,ImageWidth(pic1),ImageHeight(pic1),ImageID(pic1))
EndIf
EndProcedure
Procedure LoadingError(Type, Filename$)
Debug Filename$ + ": loading error"
EndProcedure