| Function CreateButton:TGadget(label$,x,y,w,h,group:TGadget,style=BUTTON_PUSH) |
| Constant | Meaning |
|---|---|
| BUTTON_PUSH | Standard push button |
| BUTTON_CHECKBOX | A check box button that displays a tick when selected |
| BUTTON_RADIO | A radio button is accompanied by a small circular indicator, filled when selected |
| BUTTON_OK | Standard push button that is also activated when the user presses the RETURN key |
| BUTTON_CANCEL | Standard push button that is also activated when the user presses the ESCAPE key |
| SuperStrict Local MyWindow:TGadget=CreateWindow("Button Example", 200,200,320,240) Local MyButton:TGadget=CreateButton("Text",140,60,80,40, MyWindow,BUTTON_OK) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETACTION SetGadgetText(MyButton,"Button clicked") End Select SetStatusText MyWindow, CurrentEvent.ToString() Forever |
![]() |
| SuperStrict Local MyWindow:TGadget=CreateWindow("Button Example", 200,200,320,240) Local MyButton:TGadget=CreateButton("Text",140,60,80,40, MyWindow,BUTTON_OK) Repeat ActivateGadget MyButton WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETACTION SetGadgetText(MyButton,"Button clicked") End Select SetStatusText MyWindow, CurrentEvent.ToString() Forever |
| SuperStrict Local MyWindow:TGadget=CreateWindow("Button Example", 200,200,320,240) Local MyButton:TGadget=CreateButton("Text",140,60,80,40, MyWindow,BUTTON_CANCEL) Repeat ActivateGadget MyButton WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETACTION SetGadgetText(MyButton,"Button clicked") End Select SetStatusText MyWindow, CurrentEvent.ToString() Forever |
| Function CreateLabel:TGadget(name$,x,y,w,h,group:TGadget,style=0) |
| SuperStrict Local MyWindow:TGadget=CreateWindow("Button Example", 200,200,320,240) Local MyButton:TGadget=CreateButton("Select Me",120,60,100,40, MyWindow,BUTTON_RADIO) Local Label:TGadget=CreateLabel("Blank",5,100,300,40, MyWindow) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETACTION SetGadgetText(MyButton,"Selected") End Select SetGadgetText Label, CurrentEvent.ToString() Forever |
![]() |
![]() |
| SuperStrict Local MyWindow:TGadget=CreateWindow("Radio Button Example", 200,200,320,240) Local Label0:TGadget=CreateLabel("Do you like MaxGUI?",80,10,300,20, MyWindow) Local Radio1:TGadget=CreateButton("Yes",120,40,100,20, MyWindow,BUTTON_RADIO) Local Radio2:TGadget=CreateButton("No",120,60,100,20, MyWindow,BUTTON_RADIO) Local Radio3:TGadget=CreateButton("No Opinion",120,80,100,20, MyWindow,BUTTON_RADIO) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End End Select Forever |
![]() |
| SuperStrict Local MyWindow:TGadget=CreateWindow("Radio Button Example", 200,200,320,240) Local Label0:TGadget=CreateLabel("Do you like MaxGUI?",80,10,300,20, MyWindow) Local Radio1:TGadget=CreateButton("Yes",120,40,100,20, MyWindow,BUTTON_RADIO) Local Radio2:TGadget=CreateButton("No",120,60,100,20, MyWindow,BUTTON_RADIO) Local Radio3:TGadget=CreateButton("No Opinion",120,80,100,20, MyWindow,BUTTON_RADIO) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End End Select If ButtonState(Radio1)=True SetStatusText MyWindow,"You are indeed a wise person" Else SetStatusText MyWindow,"I'm still waiting for the correct answer" EndIf Forever |
![]() |
![]() |
| SuperStrict Local MyWindow:TGadget=CreateWindow("Checkbox Button Example", 200,200,320,240) Local Label0:TGadget=CreateLabel("Select the Product you wish to buy",80,10,300,20, MyWindow) Local BlitzMax:TGadget=CreateButton("Blitzmax $80",120,40,100,20, MyWindow,BUTTON_CHECKBOX) Local MaxGUI:TGadget=CreateButton("MaxGUI $25",120,60,100,20, MyWindow,BUTTON_CHECKBOX) Local BlitzPlus:TGadget=CreateButton("I am a registered Blitzplus owner",80,80,200,20, MyWindow, BUTTON_CHECKBOX) Local Total:TGadget=CreateLabel("Total in Basket $",60,110,300,20, MyWindow) Local Amount:Int Repeat WaitEvent() Amount=0 Select EventID() Case EVENT_WINDOWCLOSE End End Select If ButtonState(BlitzMax)=True Amount=80 If ButtonState(MaxGUI)=True If ButtonState(BlitzPlus)=False Amount=Amount+25 EndIf SetGadgetText Total,"Total in Basket $"+Amount+".00" Forever |
![]() |
| Local BlitzMax:TGadget=CreateButton("Blitzmax $80",120,40,100,20,
MyWindow,BUTTON_CHECKBOX) Local MaxGUI:TGadget=CreateButton("MaxGUI $25",120,60,100,20, MyWindow,BUTTON_CHECKBOX) Local BlitzPlus:TGadget=CreateButton("I am a registered Blitzplus owner",80,80,200,20, MyWindow, BUTTON_CHECKBOX) |
| Local Total:TGadget=CreateLabel("Total in Basket $",60,110,300,20, MyWindow) Local Amount:Int |
| If ButtonState(BlitzMax)=True Amount=80 |
| If ButtonState(MaxGUI)=True If ButtonState(BlitzPlus)=False Amount=Amount+25 EndIf |
| SetGadgetText Total,"Total in Basket $"+Amount+".00" |