Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

What libraries for a simple gui?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
19 posts • Page 1 of 1
Author
Message
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

What libraries for a simple gui?

  • Quote

Post by szatox » Tue Jul 01, 2025 12:10 pm

It's going to be a while until I actually get to work, but I want to gather some ideas in advance.

I will want to make a very simple GUI, and I'm looking for a toolkit for the job. I hope for:
Something light-weight and easy to start with, preferably already in portage, though it is not a hard requirement.
It needs to immediately respond to both, user's clicks and drags as well as events from the controlled application.
I'll need runtime-determined number of boxes containing text labels (it must not spill out) placed at arbitrary locations and a bunch of lines with some color and thickness.

I think I'll go with LUA for this one, but I'm open to other options. There will be no heavy computation to do, mostly array / table manipulation for maintaining the state. Either way: I'll need bindings and docs (and probably tutorials for dummies / beginner's guides)

That's about it, what are your thoughts?
Make Pipewire a system service
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Tue Jul 01, 2025 12:40 pm

Unfortunately I don't think that there are a lot of simple toolkits, gtk and qt pretty much dominate.
But a gui for what, framebuffer, X or wayland? And which binding language?

http://lua-users.org/wiki/GraphicalUser ... ceToolkits
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Tue Jul 01, 2025 1:38 pm

GUI for X11 for now, I kinda expect the toolkit to take care of wayland compatibility too. But it's not a priority.

What do you mean by which binding language?
I suppose I'll be writing it in LUA, so I'd need lua bindings for the toolkit. But I'm not fully committed to this choice, I might take something else if there is a good combo for simple apps that's also beginner friendly.
Make Pipewire a system service
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Tue Jul 01, 2025 2:49 pm

szatox wrote:GUI for X11 for now, I kinda expect the toolkit to take care of wayland compatibility too. But it's not a priority.

What do you mean by which binding language?
C, C++, Rust, etc with lua used for configuration and or special shapes, like people that use conky sometime make.

Depending on what you are doing something like Xdialog might work
Where Xdialog handles gui front end, and a scripting language used for logic.

I know the xdialog package in portage is old and based on gtk2, but someone extended it to work with gtk3, I use it as a simple menu frontend.
But Xdialog is pretty versatile, both with input and output forms.
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Tue Jul 01, 2025 4:22 pm

gtk-layer-shell or something like that is popular among developers of small and medium tools for Wayland compositors. I think it should work fine for X. Under Wayland, it's XWayland's job to provide compatibility, not the toolkit or library.

Best Regards,
Georgi
Top
Zucca
Moderator
Moderator
User avatar
Posts: 4690
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

  • Quote

Post by Zucca » Tue Jul 01, 2025 5:51 pm

FLTK?
..: Zucca :..

Code: Select all

init=/sbin/openrc-init
-systemd -logind -elogind seatd
I am NaN! I am a man!
Top
xaviermiller
Bodhisattva
Bodhisattva
User avatar
Posts: 8738
Joined: Fri Jul 23, 2004 6:49 pm
Location: ~Brussels - Belgique
Contact:
Contact xaviermiller
Website

  • Quote

Post by xaviermiller » Tue Jul 01, 2025 7:54 pm

or tcl/tk ?
Kind regards,
Xavier Miller
Top
wjb
l33t
l33t
User avatar
Posts: 681
Joined: Sun Jul 10, 2005 9:40 am
Location: Fife, Scotland

  • Quote

Post by wjb » Wed Jul 02, 2025 9:39 am

Tk is really neat and there are bindings for quite a few languages - there is a lua binding (albeit not in portage). Git and mercurial use tk for their gui repository browsers. Platform independent.

Qml for something pretty, although you do have to understand the basics of Qt signals/slots.

Imgui because the demo is awesome. C++ with a game-type event loop. OpenGL / Vulkan.
Top
Zucca
Moderator
Moderator
User avatar
Posts: 4690
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

  • Quote

Post by Zucca » Wed Jul 02, 2025 10:18 am

wjb wrote:Imgui because the demo is awesome. C++ with a game-type event loop. OpenGL / Vulkan.
Oh yes. This has to be the most eye-pleasing lightweight gui toolkit.
..: Zucca :..

Code: Select all

init=/sbin/openrc-init
-systemd -logind -elogind seatd
I am NaN! I am a man!
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Thu Jul 03, 2025 9:38 am

I hope to do logic in lua, and call something that will draw a window for me from within the script rather than writing logic in some other language and relegating lua to configs. If I were to do that, I'd rather simplify it by not inclding lua at all and just going with the other language.
Xdialog is pretty versatile, both with input and output forms.
"xdialog" looks like something that is displayed, waits for the user to click a button, and closes returning the response. I need something that can be modified after it has been displayed, and also respond to events different than clicking a button.
The other xdialog I found mentiones javascript... Is it the one you meant? Does it mean I'd need nodejs? 80MB of dependencies is quite a lot.

FLTK, TCL/TK and imgui all look pretty good at the first glance, do you guys have any experience with them?
How easy or difficult to start with are they?

Also, bindings... When I was digging around looking for toolkits, generators were mentioned a bunch of times, without details on using them.
I found moonlibs too. Has anyone used it? Is is good? https://github.com/stetre/moonlibs
Make Pipewire a system service
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Thu Jul 03, 2025 10:42 am

https://github.com/wdlkmpx/Xdialog is what I use, I made my own ebuild.
It's just the original xdialog updated to use gtk3.

and these are the different boxes http://web.mit.edu/outland/share/doc/Xd ... 2/box.html


Not used fltk, but tcl/tk is relatively easy, given that tcl is a script language, and it integrates well with expect if something like that is needed.

Expect -> DESCRIPTION="tool for automating interactive applications"
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
C5ace
Guru
Guru
Posts: 517
Joined: Mon Dec 23, 2013 12:44 am
Location: Brisbane, Australia

  • Quote

Post by C5ace » Thu Jul 03, 2025 11:01 am

szatox:

Have look at Glade (dev-util/glade-3.40.0-r2). Also if you can find it Anjuta IDE with Glade Plugin.

Or more simple, glade-2.12.2, which generated the C code for the GUI. You then only have to code the callback functions and logic to be displayed in windows, display boxes and read from input boxes. I used this a few years back to code some customs applications. I still have the ebuild and tar file with examples available.
Observation after 30 years working with computers:
All software has known and unknown bugs and vulnerabilities. Especially software written in complex, unstable and object oriented languages such as perl, python, C++, C#, Rust and the likes.
Top
wjb
l33t
l33t
User avatar
Posts: 681
Joined: Sun Jul 10, 2005 9:40 am
Location: Fife, Scotland

  • Quote

Post by wjb » Thu Jul 03, 2025 6:38 pm

For tcl/tk, if you have tk (8.6) installed take a look at the demo app which shows what it can do (and how its done).
$ wish /usr/lib64/tk8.6/demos/widget

I personally find tcl a bit hard going after a dozen or so lines so the two times I used tk for real at work it was python & tkinter. One app was a sequence of dialogs to configure a build script that had a lot of interdependent parameters, then hung around to announce success/fail of said build. The other app was a control panel used to start / stop / monitor multiple groups of PCs in a testing lab - nothing complicated: a pretty diagram overlaid with clicky bits, a big list of PCs details and wake-on-lan + remote shutdown + ping.
Top
sublogic
Guru
Guru
User avatar
Posts: 386
Joined: Mon Mar 21, 2022 3:02 am
Location: Pennsylvania, USA

  • Quote

Post by sublogic » Thu Jul 03, 2025 10:59 pm

szatox wrote:FLTK, TCL/TK and imgui all look pretty good at the first glance, do you guys have any experience with them?
How easy or difficult to start with are they?
I have used FLTK and TCL/TK in the past.

For FLTK, you have to code in C++ but they use just the object-oriented features of the language, no RTTI or exceptions or STL. If you emerge fltk with [doc examples] you'll find plenty of code on which to build. It's a learning experience, like installing Gentoo, but longer and easier :) .

For TCL/TK, well you have to learn TCL, which is a bit weird but has its plusses.

There are front-ends like https://pyfltk.sourceforge.io/ . I don't know what there is on offer for lua.
Top
Genone
Retired Dev
Retired Dev
User avatar
Posts: 9656
Joined: Fri Mar 14, 2003 6:02 pm
Location: beyond the rim

  • Quote

Post by Genone » Fri Jul 04, 2025 9:26 am

Most likely won't fit your "lightweight" requirement, but for simple projects I'd look into Tkinter or Pyside6 for ease-of-use and multi-platform support (and to avoid dealing with toolchains and/or niche languages).
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Tue Jul 15, 2025 11:49 am

Thanks for suggestions, everyone.

Well, pyside alone is 200MB, while LOVE is 5MB, so yeah, certainly not lightweight, but it does seem to be quite noob-friendly* with all the tutorials and examples available, so I guess it is at least OK for a prototype, before a second round to hopefully make it good with something else. Unfortunately, LOVE doesn't seem to have the guide rails which would save me tones of work manually drawing buttons.

* It does not help my python allergy though: I can't tell what the scopes of variables are until I change them and A) something else blows up B) something else doesn't blow up.
Make Pipewire a system service
Top
halcon
l33t
l33t
User avatar
Posts: 734
Joined: Sun Dec 15, 2019 8:54 pm

  • Quote

Post by halcon » Tue Jul 15, 2025 12:34 pm

szatox wrote:FLTK, TCL/TK and imgui all look pretty good at the first glance, do you guys have any experience with them?
How easy or difficult to start with are they?
I have an experience with Perl/Tk. It is very simple and lightweight, in portage.
szatox wrote:I'll need runtime-determined number of boxes containing text labels (it must not spill out) placed at arbitrary locations
I am not sure it will fit these requirements though... (If I understand them well)
szatox wrote:docs (and probably tutorials for dummies / beginner's guides)
I would not say it has good docs, due to its low popularity, but its docs, per my experience, are usable.
szatox wrote:It does not help my python allergy though: I can't tell what the scopes of variables are
Good point! Agreed! Perl does not have this problem :)
A wife asks her husband, a programmer:
- Could you please go shopping for me and buy one carton of milk, and if they have eggs, get 6?
He comes back with 6 cartons of milk.
- Why did you buy 6 cartons of milk?
- They had eggs.
Top
Naib
Watchman
Watchman
User avatar
Posts: 6101
Joined: Fri May 21, 2004 9:42 pm
Location: Removed by Neddy
Contact:
Contact Naib
Website

  • Quote

Post by Naib » Tue Jul 15, 2025 9:15 pm

What language?
if it is python I would recommend tkinter (esp ttk) as it is built-into the language and thus provides a lighter script for places with python
otherwise qt6
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Top
wildhorse
Apprentice
Apprentice
User avatar
Posts: 185
Joined: Thu Mar 16, 2006 3:59 am
Location: Estados Unidos De América

  • Quote

Post by wildhorse » Wed Jul 16, 2025 1:09 pm

Xt
https://en.wikipedia.org/wiki/X_Toolkit_Intrinsics

Beyond that: Motif
Top
Post Reply

19 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic