0

I am making a simple idea generator with Lua and I want it to display a error/notification with the output.
Something a little like this:

1

I've tried looking at other posts on stack overflow but the code was too advanced for me to understand.

Any idea how to do this?

Egor Skriptunoff
  • 23,359
  • 2
  • 34
  • 64
Seth OwO
  • 3
  • 3

1 Answers1

0

fltk4lua is easy for simple stuff like that, yea.

#! /usr/bin/env lua
--  sudo apt install libfltk1.3-dev
--  luarocks install fltk4lua

local fl = require( 'fltk4lua' )
fl .scheme( 'gtk+' )

local Width, Height = 300, 200
local Title = 'Lua Output'
local window = fl .Window( Width, Height, Title )

local icon = fl .Chart{ Width *0.1,  Height *0.1,  100,  100,  type = FL_BAR_CHART }
local text = fl .Box{ Width *0.5,  Height *0.3,  100,  30,  'Hello World!' }
local button = fl .Button{ Width *0.5,  Height *0.75,  100,  30,  'Okay' }

icon :add( 6,  6,  0x05 )  --   www.fltk.org/doc-1.3/drawing.html#drawing_colors
icon :add( 5,  5,  0x04 )
icon :add( 4,  4,  0x02 )
icon :add( 3,  3,  0x01 )

window :end_group()
window :show( arg )
fl .run()
Doyousketch2
  • 2,060
  • 1
  • 11
  • 11
  • When I Run it with the lua-fltk4lua-master in my workspace and the code at the bottom of my script, it says "Exception has occurred: module 'fltk4lua' not found:" How do I fix this? – Seth OwO Jun 24 '21 at 21:09
  • `-master` implies you cloned it from GitHub. I wrote install instructions in there `luarocks install fltk4lua`, but you decided to do it a different way. Either use luarocks, or learn how to compile it from that repo clone. – Doyousketch2 Jun 24 '21 at 21:19
  • I'm confused, what do I need to put in workspace and how do I do get luarocks? – Seth OwO Jun 25 '21 at 15:08