Giving up bash/gtkdialog apps, moving to bash/yad and IUPLua

News, happenings
Post Reply
Message
Author
wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

Giving up bash/gtkdialog apps, moving to bash/yad and IUPLua

#1 Post by wiak »

I am dropping bash/gtkdialog use in preference to bash/yad or IUP+Lua for my own apps/utilities. Yad or IUPLua can be used for easily creating simple dialogs and IUP+Lua can additionally be used for more complex programs where bash/gtkdialog would previously often be used.

Reasons:

1. gtkdialog not really being developed and only works with GTK2+ (or earlier GTK1 version), and personally I find gtkdialog messy, tricky, and limiting since relies on exporting/processing large enviromental variable, which holds the dialog information.

2. Both yad and IUP+Lua can be compiled to use either GTK2 or GTK3 and are both simpler to use than gtkdialog, I feel, (and similar to each other for simple dialogs).

3. IUP with Lua has a long pedigree of maintenance and ongoing development (decades) and is actively developed with professional backing.

I am soon going release my first IUP+Lua program, simply as a demonstration of how to convert a simple bash/yad app to IUPLua shortly. For that demo I am purposively simply translating fredx181's gifenc-yad program to gifenc-iup.lua version of similar simplicity and size (I hope) - I have already completed the main GUI for that (in around 40 simple lines of code, so very much like the yad version). That exemplar should hopefully inspire/help others to implement GUI's in IUP+Lua, which will as I say be particularly useful for more complex application writing (since has full power of Lua). For example something of the complexity of Pmusic could be implemented in IUP+Lua (GTK2 or GTK3 version) and a lot of the syntax of Lua itself is very much simpler than bash (though bash has the advantage of many already being familiar with it).

With IUP+Lua a developer or someone keen to become a developer could also design/program simple webbrowsers or filemanagers or texteditors (or more) in a relatively straightforward way (unlike Qt or pure GTK programming, which is somewhat 'heavy' on the brain... and I say that as someone who has long been able to program in C).

Reason I'm writing this is that my own wish would be that Puppy would start to include IUP+Lua as standard, for the future, despite it being a larger install size than either yad or gtkdialog (but basic IUP+Lua system is only just over 1 MB installed size anyway - that's uncompressed already). I'm never myself been happy with gtkdialog and wished for something more elegant/powerful. Yad is very nice, up to its limits, but for something larger gtkdialog needs superseded IMO and IUP+Lua really has little in the way of limits (and is a long established platform with a nice simple very useful IDE (zerobrane) though can also use geany.

I am particularly motivated to move to IUP+Lua, because I think longterm a small distribution like Puppy (or the Dogs for that matter) show their individuality, to some extent, via their personalised small app/utilities. Whilst some think Puppy is just for 'passengers', I don't. It is for passengers from Windows, for example, but it has also been strong as a simple distribution for experimenting and learning how to code small utils and system apps. Some, such as myself, who enjoy developing an app or utility now and then, may long for a development language more powerful than bash/gtkdialog (or bash/yad) but without having to go the full Qt/GTK compiling route. IUP+Lua can certainly fill that void - and it is cross-platform so apps created in IUP+Lua can be written to also work in other UNIX systems or on Windoze for that matter.

Anyway, any app I myself write in the future will be using either bash/yad or IUP+Lua and more often the latter. Python with some GUI widget toolkit may be nice, but it is too big by default. Of course, I realise that system builders may not with to add IUP+Lua to their builds and others may not wish to learn something new, in which case I will be alone and my IUP+Lua-based apps useful therefore to no-one but myself! C'est la vie! They will probably not be very good anyway, but entertaining and educating for me writing them at least ;-)

IUP+Lua docs/install files etc:

http://www.murga-linux.com/puppy/viewto ... 238#988238

The reason I'm wishing IUP+Lua would be available on default Puppy/Dog isos is that no-one is seriously going to use apps/utils that requires a devx or even a prior package manager install before using them. Of course, I have IUP+Lua permanently installed on my own system or the apps would be no use to me either. I'm only one potential developer though, so not much would be written by me alone anyway and without IUP+Lua inbuilt availability it seems unlikely other developers would use it for new apps, which would be sad for future Puppy progression IMO (or if there is something better fine - but Bacon, for example, didn't really take off in the end, but apps written in that needed compiling anyway, which is a major drawback for this kind of quick-app building process).

wiak

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

Hi,
I am interested in what you are doing.

Certainly I will consider an alternative to bash/gtkdialog for my forks of Puppy (EasyOS and Quirky), if I can see some demonstrated advantages.

Moving ahead, yes, support for gtk3 is a plus.

Lua, I know nothing about, so don't know what challenges lie there.

In pups and also my forks, there are some apps written in BaCon with HUG. This is a compiled solution, whereas many people like to stay with scripts -- and I can certainly appreciate that.

BaCon will compile for gtk2, gtk3 and fltk. I think the HUG support for fltk is a work-in-progress.

Yeah, I might put IUP/Lua in the next release of EasyOS, as it is intended as an experimental distribution. I have added this to my to-do liist.

Regards,
Barry
[url]https://bkhome.org/news/[/url]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#3 Post by rufwoof »

yad with sh (standard script) is more portable

Attached is a back-burner (incomplete) ROX APPDIR for a simple alarm script. I've had to strip out the alarm sound files in order to get the tar.gz file to below the 250KB board posting size limit. Script lacks code to test and switch to use the appropriate files, but that's relatively easily manually changed in the alarm shell script. All of the files are in the APPDIR, yad icons ...etc (other than the removed alarm sound files).

Contains copies of yad for OpenBSD 6.3 (i386 single processor and amd64 multi-processor) along with Debian AMD64 (Jessie). Using ROX in all of those I can just drag the alarm APPDIR to my rox panel and (after right clicking and using the look-inside ... to edit the alarm script to use the correct yad and sound files etc.) run it from there on each of Debian Jessie and OpenBSD.

I didn't even know that IUPLua existed so thanks wiak, something new to learn/investigate.
Attachments
alarm.tar.gz
(250.63 KiB) Downloaded 136 times
s.png
(77.7 KiB) Downloaded 277 times

User avatar
FeodorF
Posts: 293
Joined: Wed 07 Jul 2010, 09:44
Location: Heidelberg, Germany

Lua

#4 Post by FeodorF »

A very well documented example on how you can use Lua.

youtube user 'CS50' "Falling in LÖVE with Lua"

... While modern AAA game engines like Unity and Unreal can make 3D cutting-edge game development exceptionally easier, they may not always be the best tool for modern 2D game development or the greatest entry point for a newcomer to the field. Enter LÖVE 2D: a simple and clean 2D game development framework utilizing Lua as its scripting language. ...

https://www.youtube.com/watch?v=3k4CMAaNCuk

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

gifenc-iup.lua translation of early version of gifenc-yad

#5 Post by wiak »

Please find a working translation of an early version of fredx181's gifenc-yad into IUP/Lua as an exemplar for developers here:

http://www.murga-linux.com/puppy/viewto ... 818#988818

wiak

Post Reply