PFP9W.net Permanent Floating Plan 9 Workshop

controlfs

This might need a clean up of the control(2) code. Or possibly using some other GUI toolkit library. The 9front wiki recommends nuklear. For now, I will just refer to the general idea as "controlfs".


The purpose is to create a file system abstraction for drawing GUI features into a window. This would allow for using rc, Lua, Go, or any other programming or scripting language that can open/read/write a file to be used to make GUI programs on 9front.

The basic idea is to bind a controlfs to the to the rio /wsys of the current window. From there, controlfs will add a ctl file that will accept text in the format needed to add things like buttons, sliders, and text boxes. These add command should incude a label that will be translated into an access file for the feature, and be used to remove the file and GUI feature.

This might look something like

add button okbutton minx,miny,maxx,maxy OK

This would create a button in the window at a given location with the text "OK" inside it. And in the /wsys directory will be a file named "okbutton". Writes to the file could do things like move the location, for window scaling, or change the text in the button. Reading the file would report on a button press.

things to consider

Should it have a relative or scale mode? An option to allow the features to be scaled to the origin, or even relative to other features.

How to handle reading from feature's file give that blocking reads are the norm in 9front? Possibly a global "event" file? Let the programmer figure it out, or use what ever options are available in the language used?