3 ms·
> It wasn’t a big deal to just write a simple C program to make a program with a GUI, even if it was a bit ugly and crude. These days the few times I’ve tried
by lelanthran 4y ago
> It wasn’t a big deal to just write a simple C program to make a program with a GUI, even if it was a bit ugly and crude. These days the few times I’ve tried I just give up: too many abstraction layers, too much complexity, too high of a learning curve wading through poor documentation.
That is correct, if you want to write your program using C (or similar), but if you want to do simple GUI programs, there's enough support in existing c/line programs. Use zenity, wmctrl, etc.
Here's a basic pomodoro clock written in bash: https://gist.github.com/lelanthran/bbbcf5c8b6b26c9bc0263384a22b4f61 https://gist.github.com/lelanthran/bbbcf5c8b6b26c9bc0263384a...
- kragen 4y agoHow would you do something like https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/%CE%BCpaint.c https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/%CE%BC... (a simple paint program), https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/mand.py https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/mand.p... (a Mandelbrot renderer), or https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/glyphed.c https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/glyphe... (a fatbits pixel font editor) with zenity, wmctrl, etc.? All three of these are less than 40 lines of code. The best things I've found for simple GUI programs these days are Tk and HTML+JS.
- lelanthran 4y agoAll those examples require a canvas. For simple GUI applications that mostly just take input from the user and produce output in a non-canvas form, zenity usually works.
- kragen 4y agoI would argue that if your "graphical user interface" doesn't involve any actual graphics, you shouldn't call it a "graphical user interface" ("GUI"). Zenity can't do any actual graphics, just text you can point at with a mouse.
- lelanthran 4y ago> I would argue that if your "graphical user interface" doesn't involve any actual graphics It does GUI, according to most common understandings of the term. From https://en.wikipedia.org/wiki/Graphical_user_interface https://en.wikipedia.org/wiki/Graphical_user_interface: > The GUI (/ˌdʒiːjuːˈaɪ/ JEE-yoo-EYE[1][Note 1] or /ˈɡuːi/[2] GOO-ee), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based UIs, typed command labels or text navigation. Unless you want to argue that being capable of rendering images isn't "graphical". > Zenity can't do any actual graphics, just text you can point at with a mouse. It does scrollbars, progress sliders (also animated if you want), buttons, images, lines, boxes, maybe more stuff. None of those are plain text. TBH, I'm confused by your complaint - you wanted an easy way to produce simple GUI applications. Hardly anyone would consider a paint program a simple application, nor do most people consider a file open dialog as a text interface.
- kragen 4y ago> TBH, I'm confused by your complaint - you wanted an easy way to produce simple GUI applications. In this thread, that was porcoda, not me, but it is also true that "an easy way to produce simple GUI applications" is a good summary of why I wrote Yeso in the first place. > Hardly anyone would consider a paint program a simple application Seriously? It's 19 fucking lines of C. Including the fucking curly braces. What would you consider a simple application?
- lelanthran 4y ago> Seriously? It's 19 fucking lines of C. Including the fucking curly braces. What would you consider a simple application? We don't consider programs to be simple or complex based on the number of lines of code used to write them, otherwise the linux kernel is even simpler than your paint program because a single-line grub script calls it. Hell, I can make an even simpler program than your 19 line paint program, by writing a shell script that calls open-office in 1 line. You still think number of lines of the calling program matters to determine complexity? Simplicity (or complexity) is, for most, determined by what functions are available to the user. A program that does 20 different things is more complex than a program that does a single thing, even if those 20 different things are actually done by a library.