scripts manual

68 views
Skip to first unread message

Rainer Hoefs privat

unread,
Nov 4, 2018, 8:03:04 AM11/4/18
to gra...@googlegroups.com
Hi,

any chance to get more information about this:

Allow factory scripts full access to our widget/window system, for more comple UIs: sliders, textboxes, and more.

Syntax, gui-look and so on.

Thanks

Rainer Hoefs
*******************************
Rainer Hoefs
Schillerstraße 11
D-86842 Türkheim
Phone:  +49 (0)8245 904446
Fax:       +49 (0)8245 9049661
Mobile: +49 (0)172 8924631
email:    rai...@rainer-elke.de
*******************************

Adrien Destugues

unread,
Nov 4, 2018, 3:47:03 PM11/4/18
to gra...@googlegroups.com
On Sun, Nov 04, 2018 at 02:03:02PM +0100, Rainer Hoefs privat wrote:
> Hi,
>
> any chance to get more information about this:
>
> Allow factory scripts full access to our widget/window system, for more comple UIs: sliders, textboxes, and more.
>
> Syntax, gui-look and so on.

The documentation for scripts is here:

http://pulkomandy.tk/projects/GrafX2/wiki/UserGuide/Lua

However we don't have documentation for the new functions: windowopen,
windowclose, windowdodialog, windowbutton, windowrepeatbutton,
windowinput, windowreadline, windowprint, windowslider,
windowmoveslider.

You will have to figure out the arguments, or maybe look at
Dawnbringer's toolbox for example uses, until the documentation is
updated.

Adrien Destugues

unread,
Nov 6, 2018, 2:12:46 PM11/6/18
to gra...@googlegroups.com
On Sun, Nov 04, 2018 at 02:03:02PM +0100, Rainer Hoefs privat wrote:
> Hi,
>
> any chance to get more information about this:
>
> Allow factory scripts full access to our widget/window system, for more comple UIs: sliders, textboxes, and more.
>
> Syntax, gui-look and so on.

The page is now up to date with the documentation. Also have a look at
_tst_dialog2.lua in share/grafx2/scripts whcih provides an example of
use with an extra Lua wrapper that makes things easier.

The GUI is integrated in GrafX2 so it looks just like the other windows
we have. Let us know if the API does not allow you to do what you need,
we can extend the API as needed.

--
Adrien.

Jonathan Fortin

unread,
Jun 3, 2022, 2:44:37 AM6/3/22
to GrafX2
Which version of grafx2 includes _tst_dialog2.lua?  I'm trying to get the windows working, and can't quite figure it out, nor can I find this file in the scripts folder of win32-2.8.3104

Yves Rizoud

unread,
Jun 3, 2022, 3:02:05 PM6/3/22
to grafx2
(I hope the embedded images work...)

Just to clarify, there are two families of GUI functions

1) The well-supported API provides 3 functions : 
messagebox() is simple "OK" box
inputbox() for choices like this
image.png
selectbox() for more complex user input like this :
image.png
These were extensively used by Dawnbringer in his toolbox, some of his scripts being also default "samples" in the Grafx2 distribution


2) An experimental API was made for full freedom of defining windows, it was intended to be used with the Lua wrapper "gui.lua" rather than calling these functions "by hand"
It's all the functions that start with the word window (windowprint() etc.)

It was never completed, and so it's not distributed by default. But you can find the files here:
It produces almost the same window, but this time you get to assign Lua functions for click / change events, and you have bounded labels : "counter.value = counter.value+1" automatically changes the 000 on screen.

This library was abandoned because I couldn"t find a pretty way to provide dropdown menus. It's been a long time, so if anyone plays with it, I don't remember if I made safeties for controls to fit inside the parent window :If a visual element expands too much horizontally it will only be a visual bug, if they expand below the bottom of the screen it will crash.


Yves



--

---
You received this message because you are subscribed to the Google Groups "GrafX2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grafx2+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grafx2/5ea4a4a2-b0ab-47d7-b79d-1c46add8ad96n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages