Any MaxGUI turtorials out there?

Started by Juiceter, June 09, 2020, 20:13:25

Previous topic - Next topic

Juiceter

#15
After exploring it a bit this works fine for me (3 textfields). Hope it helps someone else! It seems that 2 events are posted on an Enter key (that's what it looks like to me anyway). Tabs AND Enters through fine.


' TABBING or RETURNING THROUGH TEXTFIELDS WITHOUT A BOUNCE from the 2nd text field.
' Note: no OK button needed.

Strict
Import MaxGui.Drivers

Global window:Tgadget=CreateWindow("Window",0,0,320,200)
Global g:Tgadget=CreateTextField(10,10,30,25,window)
Global g1:Tgadget=CreateTextField(10,50,30,25,window)
Global g2:Tgadget=CreateTextField(10,80,30,25,window)

ActivateGadget g
While WaitEvent()
Print CurrentEvent.ToString()
Select EventID()
Case EVENT_GADGETLOSTFOCUS
Select EventSource() 
Case g
ActivateGadget g1 ; WaitEvent ; ActivateGadget g1 ' -> Enter seems to produce 2 events! This clears the 2nd.
Case g1
ActivateGadget g2 ; WaitEvent ; ActivateGadget g2
                Case g2 Exit
         End Select

Case EVENT_WINDOWCLOSE End
End Select
Wend

Print "g="+TextFieldText$(g)
        Print "g1="+TextFieldText$(g1)
Print "g2="+TextFieldText$(g2)



Henri

I created an issue here https://github.com/bmx-ng/maxgui.mod/issues/46 to get some attention to this behavior and proposed some fixes.

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Juiceter

Thanks Henri. With that small fix it seems to be working fine now, so I suppose having it changed would mess everyone up I guess! The problem is that somewhere down the line you just know it's going to cause someone else a problem though.

Yellownakji

MaxGUI is junk;  I ditched it long ago and for good reason.

Can't help, but thinking about it makes me shudder.

Quote from: Juiceter on June 09, 2020, 20:13:25
Hi,

can anyone point me in the direction of a decent blitz maxGUI tutorial please?

I've gone through Assari's (2005) one which is pretty good but it doesn't tell me enough about events and why the dreaded return key is not picked up in textfield gadgets.

In particular I'm having a lot of trouble with EVENT_GADGETLOSTFOCUS and trapping the return key so i can act on it (perhaps disable it so I can tab between textfields instead).

EDIT: anyone know if  Slone's "blitzmax for absolute beginners" covers the GUI portion of blitz max? Has anyone read it? Is it any good?

Thanks!

Juiceter

Oh it's actually not so bad! I haven't come across many issues with it. This was one of them, but it was fixed with a little help and thought. Blitz GUI is actually quite old now so I guess if you are comparing it with something more modern then yes, it may look a bit old-fashioned.