GUI Sample Code

BlitzMax Forums/BlitzMax Beginners Area/GUI Sample Code

thalamus(Posted 2005) [#1]
Are there any sample programs to accompany the GUI module?


Perturbatio(Posted 2005) [#2]
There are lots of examples dotted throughout the docs.

if you want to manually browse them, point explorer to C:\Program Files\BlitzMax\mod\brl.mod\maxgui.mod\doc


Perturbatio(Posted 2005) [#3]
also a very simple example:

Strict

OnEnd VerifyQuit

Global MainWindow:TGadget = CreateWindow("Test", (Desktop().Width/2)-200,(Desktop().Height/2)-200,400,400)
Global TextField1:TGadget = CreateTextField(10,10,120,24,MainWindow)
	ActivateGadget(TextField1)
	SetGadgetFilter(TextField1, TextField1Filter)

Main()

End


Function Main()

While True
	WaitEvent()
	
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select

Wend

End Function


Function VerifyQuit()
	If Proceed("Are you sure you want to quit?")<> 1 Then 
		OnEnd VerifyQuit
		main()
	EndIf
End Function


Function TextField1Filter(Event:TEvent, Context:Object)
	Select event.id
		Case EVENT_KEYDOWN
			Print "Keydown detected"
	End Select
	Return 1
End Function



thalamus(Posted 2005) [#4]
Well, that's odd - no MaxGUI.mod in my directory (despite having resgistered and synched the modules).

Hmmm...


Tricky(Posted 2005) [#5]
Are you a BlitzPlus owner?
If not you need to buy the GUI modules for $25 and after having done that the synchronize should work.

Having a registered copy of BlitzMax only won't help.


thalamus(Posted 2005) [#6]
Yep, I own Blitz+ (that's the only way you can register for the GUI).


Perturbatio(Posted 2005) [#7]
Try renaming your mod directory to something else then resyncing.


xlsior(Posted 2005) [#8]
Yep, I own Blitz+ (that's the only way you can register for the GUI).


The only way to register it for free. If you pay the $25 you can register the module by itself, without owning B+.