Restored from previous forum. Originally posted by cor.
Can I create gadgets Realtime? (on the fly).
e.g. from reading an ini file.
Or must I predefine a couple of gadgets and then hide/show, activate etc.
Using Windows 98 SE
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
Creating gadgets Realtime?
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by ricardo.
In Paul's site you can find some example using an ini file (ini2GUI is the name of the example).
Here is another example:
In Paul's site you can find some example using an ini file (ini2GUI is the name of the example).
Here is another example:
Code: Select all
If OpenWindow(0,100,10,250,500,#PB_Window_SystemMenu,"Create Gadgets at Runtime!")
CreateGadgetList(WindowID())
ButtonGadget(0,1,1,90,25,"Create Button")
Repeat
EventID=WaitWindowEvent()
Select EventID
Case #PB_EventGadget
Select EventGadgetID()
Case 0
GadgetNum = GadgetNum + 1
ButtonGadget(GadgetNum,1 ,30*GadgetNum,80,25, "Button #" +Str(GadgetNum))
Default
MessageRequester("Click","Button#" + Str(EventGadgetID())+" was clicked",0)
EndSelect
EndSelect
Until EventID=#PB_EventCloseWindow
EndIf