[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gambas script capabilities


Le 09/10/2026 à 23:41, Brian G a écrit :
On 10/9/26 11:29, Olivier Cruilles wrote:
Hello everyone,

I’m currently testing a little more Gambas Scripting capabilities and I would like to have your opinion please.

As I remember, it was possible to create simple graphic application into a *.gbs script but trying to convert a simple Graphic App ‘Hello world' into a simple Form + a button Quit -> to a script .gbs using the command ‘gbs3 — convert-project /path/to/helloword/app’ , produce a script .gbs file but it does not work when I run it.

Just to clarify if it’s really possible have simple graphic forms into a .gbs script or not at all ?

Thank you


Olivier

Sorry I did notice the button to close, here is the script that also has the button to close
attached is the updated project as well. Same command line as before
gbs3 --convert-project /home/brian/test/ProjToScr /home/brian/bin

#!/usr/bin/env gbs3
'Auto Generated Script 10/09/2026 21:33:20.936 Version (3.22.99)
#Script Startup="FMain"
#Script Version="0.0.1"
Use "gb.image"
Use "gb.gui"
Use "gb.form"
class FMain
' Gambas class file

Public Sub Button1_Click()
     Quit 0
End


End class
' Gambas module file
form FMain
# Gambas Form File 3.0

{ Form Form
   MoveScaled(0,0,64,22)
   { TextLabel1 TextLabel
     MoveScaled(4,5,49,11)
     Font = Font["Noto Mono,Spacing=1.5,+6"]
     Text = ("hello world")
   }
   { Button1 Button
     MoveScaled(23,17,28,3)
     Text = ("quit")
   }
}

End form

--
~~~~ Brian


Beware that the form file syntax is not public, and may change in the future unexpectedly.

I strongly suggest not to store generated scripts that use that syntax, as they will not work in the future if the form file syntax changes.

Better create your GUI with direct Gambas instructions.

Regards,

--
Benoît Minisini.


References:
Gambas script capabilitiesOlivier Cruilles <olivier.cruilles@xxxxxxxx>
Re: Gambas script capabilitiesBrian G <brian@xxxxxxxxxxxxxxxx>