Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
EliteClubSessions

GUI: extremely fast advanced interface library

Recommended Posts

PgjHnyn.png Qf2nBht.png

oxOM8KC.png c8c83ca6d4c852d12b2d95499e150042.png

218659c1dac6c3bfae3632e3fb1a08a6.png 7eed4855a7d60a6a4a38d076bb3d9ced.png

d03dfd6d1be3cac6a8b8725a095685fb.png c973c94965710b5544a91355986ca045.png

This is an object-oriented library, the main priority of which is the maximum possible performance. It works on the double buffering concept, it has a lot of widgets, animations and custom event handlers support. All programs from the screenshots above are implemented with its help. If you want to develop a fast and beautiful program in just a few lines of code without butthurt - then this library is made for you.


Detailed illustrated documentation, installation methods and tons of practical examples are available at:

https://github.com/IgorTimofeev/GUI

Link to post
Share on other sites
On 7/9/2018 at 4:23 AM, freacknate09 said:

Where can I download the programs shown? I am gonna get the libraries, but I want those programs also

  1. It's an application market from MineOS (can be installed via pastebin run 0nm5b1ju)
  2. It's an IDE that comes with MineOS
  3. Settings application for changing wallpapers, screensavers, formatting disks, etc. Also comes with MineOS
  4. Draconic reactor control application, source code was lost on server a year ago
  5. Raycasting demo application, it's available to download in App Market
  6. Weather forecasting is also available to download in same place
  7. Something like Steam trade market, i'm too lazy to share it cause of binding to specific php scripts
  8. 3D rendering application. Also can be downloaded from App Market
Link to post
Share on other sites

Hi Igor!

Thanks for this great library and the documentation. Great Job!

I built a GUI for a complex mobfarm, everything is working as expected. But I have some questions:

1. How do I integrate my program logic to the application? I mean the part of the programm, that typically resides in a "while true do ... end" loop? By the moment the application(start) is called I have no more control. Is there a callback of the application which is called cyclically?

2. How do I update texts/labels during runtime?

3. How do I realize multiline texts/labels? "\n" or"\r" control characters do not work.

4. I found an error in the documentation on GitHub: In the properties table of the GUI.text section, the properties width and height are mentioned, but they are not part of the initialisation.

Maybe my LUA knowledge is too low and the answers are obvious. In this case: I am sorry!

 

gl&hf!

Link to post
Share on other sites

Typically the GUI and your application are separated because of the reactive nature of the GUI library. Most of your code for reacting to GUI events will go into a GUIObjects event handler.

-- # ...
myButton.eventHandler = function(app, instance, event)
  if event == "touch" then
    -- # react to touch event. Alter state, etc...
  end
end

I don't have the time to test this my self but you could try using OpenOS threads to give control back to your main script.

-- # ... more stuff up here
local thread = require 'thread'

-- # Gui logic n stuff...

-- # This will now run whenever the main script yields i.e event.pulls, os.sleeps, etc..
local guiProc = thread.create(application.start, application)

-- # Continue below with main program runtime logic.
-- # Be aware that the GUI will only be able to process stuff when this main script yields as Lua is single threaded

Multiline text is handled by GUI.textBox rather than GUI.text as far as I can tell.

Hope this helps you over the initial hump. Happy to help more if you still need it :) 

 

Link to post
Share on other sites

Hey Molinko!

Thanks for the fast reply. Your suggestion to use threads was the right hint over the bump! I understand your concerns about the reactiveness of the GUI, but my programm logic is very small. The level of a fluid tank is read every second and a rs-output is set/unset by it's value with a hysteresis. Also the fluid level is written to the GUI. Nothing special, most of the time my logic idles.

Edit: Ah, one thing: When I update GUI objects in my programm logic, I have to call application:draw(true) to actualize the values visible.

Thanks again!

gl&hf!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.