[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


Janitor acceptance emails will be sent out over the coming weeks. Make sure to check your spam folder!


[Advertise on 4chan]


>gtk3/4 is literal absolute cancer
>qt has shit license
>there is literally nothing else?
What the fuck do I use if I want to make a GUI for my program?
Don't say shit that still ends up relying on either of the above two.
What are my options? Am willing to change my distro (Debian).
inb4
>wine/winegcc
Yeah, that's the last resort. I'm really starting to believe WinAPI is the best Linux GUI toolkit...
>>
>>109438028
WPF or Avalonia. The cleanest solution. Avalonia is cross platform, WPF can run via Wine, or you can use LibreWPF:
>>
>>109438028
Anon, you sound like you're in an abusive relationship with Linux.
It's not for you. It doesn't have to. There's nothing wrong with that. You have to be either ebussi's bitch or a cuck licenser to enjoy modern Linux.
I'd suggest Motif because I heard about that once, but it's so fucking old I don't even know if it's supported at all.
But really, this is one of the few valid reasons to give up on Linux and stay on Windows, or just run everything through wine and call it a day.
>>
>>109438028
there are at least 2 rust gui libraries with no dependencies, they just output to a framebuffer and/or opengl. you can also use the x11 drawing primitives. then there are immediate mode libraries in both c and zig; you can make it so that they are only redrawn on input if you don't want them to hog resources as if they were a videogame. last but not least, there is fltk
>>
electron
>>
>>109438103
nooooooo then I’ll be a midwit!!
>>
>>109438185
>braindead
>>
>>109438028
>What the fuck do I use if I want to make a GUI for my program?
a browser
>>
>>109438028
Please, I'm begging you programmer-kun, please just use gtk or qt. Just be a native chad. Or just use the Cosmic shit, r*st iced.
>this is one of the few valid reasons to give up on Linux and stay on Windows
bro please please don't do windows evangelism
>>
>>109438195
it works
>>
>>109438239
Doesn't mean you should. You can kill yourself, should you? Yes actually you should.
>>
>>109438267
i don't do frontend so i don't care
>>
>>109438271
Pretentious assholes like you that feel like they should always butt in and then admit they have zero clue what the fuck they're talking about are the bane of the internet, worse than any bot ever.
>>
>>109438310
:-)
>>
>>109438028
>qt has shit license

as long as you are not selling the software, and not using the shit license extensions, just place QApplication::aboutQt() somewhere and you're good to go
>>
>>109438028
WinAPI or Electron
>>
>>109438028
>What the fuck do I use if I want to make a GUI for my program?
You don't need more than Xlib/XCB
Seriously, stop relying on toolkits, just code the thing yourself using the X11 API
>inb4 but muh wayland
Wayfags can just suck it up and use xwayland
>WinAPI
If you're willing to go that far then try X11 API first at least, This is how easy it is to create a window in X11:
#include <stdio.h>
#include <X11/Xlib.h>

#define WIDTH 600
#define HEIGHT 400

int main() {
// Open the display
Display* display = XOpenDisplay(NULL);
if (display == NULL) {
fprintf(stderr, "Failed to open display, check your DISPLAY environment variable\n");
return 1;
}

// Get the root window
Window root_window = DefaultRootWindow(display);
// Create the main window
Window my_window = XCreateSimpleWindow(display, root_window, 0, 0, WIDTH, HEIGHT, 0, 0, 0);
// Register the WM_DELETE_WINDOW and set window manager protocols to recognize it
Atom wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False);
XSetWMProtocols(display, my_window, &wm_delete_window, 1);
// Select mouse events
long const event_mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
XSelectInput(display, my_window, event_mask);
// Map the window (i.e. show the window)
XMapWindow(display, my_window);

Bool should_close = False;
while (!should_close) {
XEvent event;
XNextEvent(display, &event);
printf("Caught event %d\n", event.type);
switch (event.type) {
case ClientMessage: if ((Atom) event.xclient.data.l[0] == wm_delete_window) should_close = True;
break;
}
}

XCloseDisplay(display);
return 0;
}
>>
>>109438028
imgui if you just need a quick&dirty solution.

also QT license cancer depends on how you use it, the licensing is fragmented into what functionality you use. If you use charts you get raped, if you only use core then you get a better deal but thats for non-profit. If you wanna sell shit then QT only works if you are a massive company.


Last option is you simply write the gui in python and glue python to your C++
>>
tk, iup, fltk are all small
also wxwidgets exists
>>
>>109438362
>use X11 as your gui toolkit
Holy shit, you CAN do that?
>>
>>109438404
Just like you can cut your leg off. You CAN, doesn't mean you SHOULD.
It will never look good, unless you're an experienced GUI toolkit developer. If you were, you wouldn't be asking questions like that.
>>
>>109438335
>has no idea what he is talking about
>>
>>109438028
FLTK is functional enough for many scientific programs.
>>
>>109438404
Don't listen to the other guy, you absolutely can and you should, just do it
>>
>>109438469
>>109438195
go ahead and explain what is wrong with electron. "hurr durr packing a browser bad" is a midwit answer.
>>
>>109438028
picrel was made by a midwit btw
>>
>>109438028
Electron.
>>
>>109438496
That's literally it. Packing a browser is bad and there's no possible justification for it. Anyone who uses Electron is braindead.

What about you going ahead and telling us what is good about electron? "hur durr cross platform and development velocity" is a midwitt answer.
>>
File: capture.png (89 KB, 1070x811)
89 KB PNG
>>109438028
>use gui
truly a galaxy brain idea
>>
>>109438334
>>109438376
>imagine putting your effort into using a pozzed quasi-proprietary commercial library whose loicense you have to babysit for a brand new application
>>
>>109438559
>tfw had to mass-rename some shit today
>tfw I found exactly what I would have used in that GUI
>tfw it took me five minutes to google and understand how to do it from the command line
Oh yeah, sure a big point against GUIs, huh. Sure showed 'em, champ.
>>
>>109438574
Schroedinger's use case. If you do it all the time you have the command line version memorized. If you almost never do it, it's still faster to ask AI and copy-paste the solution than install a new program and learn the interface.

BONUS: Even the GUI doesn't save you from learning regex.
>>
>>109438028
Tcl/tk
>>
>>109438574
Using a GUI for moving files around, navigating folders, or bulk renaming is a lot safer and more convenient than using a CLI.
>>
ascend to .js based gui
>>
>>109438562
the thing is if you do it as a career project or never publish with your name then it makes sense to use QT since license wont matter. And companies use QT which means its a good choice if he is doing it for his portfolio.
>>
>>109438543
being able to use html/css for your gui and other web technologies. interesting you think cross-platform isn't valuable. before addressing you as a tech illiterate for just parroting things youve heard before, curious as to what you use to develop cross platform gui?
>>
>>109438633
>being able to use html/css for your gui and other web technologies.
That's an advantage? More like a downgrade.
>interesting you think cross-platform isn't valuable.
Verry valuable.
>curious as to what you use to develop cross platform gui?
UNO and Avalonia.
>>
>>109438574
the patrician option is to use emacs
with keyboard macros it's as simple as editing a text file
>>
File: xraycast.png (380 KB, 1917x1079)
380 KB PNG
>>109438404
nta, but I built this in xlib.

i didn't have time to fix the incorrect rounding on buttons and add aa, but this turned out pretty functional
>>
>>109438604
>Using a GUI for moving files around, navigating folders, or bulk renaming is a lot safer and more convenient than using a CLI.
Save yes, convenient never
what CLI really means is you write a rule for renaming that gets applied automated which allows complex actions with one line. Thats impossible to replicate in a GUI aside from offering a command line prompt or a Node Graphs system which its a bigger mess than writing a regex term.

Ive been using graph node systems in blender and went back to writing shader code because its way easier.
>>
>>109438625
Learning the framework still takes a considerable amount of effort. Why but learn a framework that's actually free then?
I wouldn't bank on ever using QT at work. It's good to know I suppose, but I wouldn't consider it too important.
>>
>>109438640
>irrelevant bullshit
>c# plantation nigger
LOL
>>
>>109438028
Tk is actually quite good and cross-platform. There is also wxWidgets but I haven't used that. Tauri is fine for WebView stuff if you want to go that route. For what it's worth, the vast majority of Qt is LGPL, there are only a few deployable components that are GPL, so if you dynamically link then you won't really have any issues.
>>
>>109438687
>Javascript brainrot calls me C# nigger.
>calls his own points irrelevant.
What went wrong with him?
>>
>>109438663
It is a lot more convenient to navigate on a gui instead of cd whatever ls -lah cd .. ls -lah cd .. cd .. ls -lah then *opens ai: @grok how do I show the size of a folder on Linux again* rm -rf /volume0/home/ *accidentally hits enter* ACK!!
For renaming, it's a lot more dangerous if you can't see the changes before applying them.
Automation is obviously easier through scripts, but in many cases, you don't need automation.
>>
>>109438692
Weak Electron devs cannot endure the weight of reality when they are out of arguments.
>>
>>109438716
>>109438692
samefag
>>
>>109438660
does this use software rendering or opengl through glx?
>>
>>109438723
>samefag

His last resort to winning an argument
>>
>>109438669
>Why but learn a framework that's actually free then?

because the other frameworks are all shit, unfortunately. Qt is the least shit of the bunch, and multiplatform actually works.
>>
>>109438712
>For renaming, it's a lot more dangerous if you can't see the changes before applying them.
This just makes you sound like a nigger who doesn't use versioning
>>
>>109438028
There's also Flutter. Ubuntu uses it for its own applications. The problem is that the widget toolkit they made is using their Yaru theming and nothing else. Nothing Claude can't fix, though, I guess. Could probably even read GTK theming information for the widget rendering.

IMO every option you have sucks shit and everything will break in mysterious ways. Making a proper application framework is much more difficult than "I have an event loop and I can draw widgets.", but nobody wants to actually put the work in. Shit like FLTK or Dear ImGUI were made to be embedded into other applications for things like debug menus and it shows.
It's no wonder every application is a web browser nowadays. Browser engines have solved the hard shit on every platform - integration with the system compositor for efficient, jank free, native scrolling and texture usage, laying, supporting all kinds of input devices, GPU acceleration, accessibility, a proper threaded rendering pipeline, integration with the operating system's native Text control APIs for proper text editing in all languages, supporting rendering arbitrary unicode (with RTL, properly segmented, properly wrapped etc.) and what not.
Thanks to Grid and Flexbox, browsers actually make it easier than every other option to lay shit out the way you want and I take CSS for styling shit over onPaint(SomeFuckingPaintContexHaveFunAsshole* ctx) any day of the week.

But it fucking SUCKS. Web browsers are so insanely resource hungry that I don't want to use them. I hate using other people's webshit and I hate forcing others to use mine.
>>
>>109438028
>>qt has shit license
can this meme die already? LGPL2 is fine
>>
>>109438807
I want to make some internal applications at work and I don't trust the Qt company won't sue the shit out of my company if I use the LGPL version.
>>
>>109438028
>What are my options?
godot 2d
>>
>>109438825
>internal
holy lol
>>
>>109438735
not accepting someone's points does not mean you win an argument. you have to be an incredibly pretentious faggot to actually argue against html/css.
>>
win32 / xcb and vulkan
you don't need anything else
>>
>>109438825
You're retarded or trolling. LGPL is trivial to comply with, especially for an internal tool. Even GPL is fine for internal tools so long as you can guarantee those tools will never be distributed outside of the company.
>>
>>109438028
Just use GTK or QT goofy ass autist nigga.
>>
egui
>>
>>109438594
Reminder that AI is trained on beautiful stuff like this:
https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/commit/6cd6b2485668e8a87485cb34ca8a0a937e73f16d
Who the fuck is retarded enough to copy-paste shit straight from it?
>>
Does X/X11/Xlib have a bible like picrel?
>>
File: 2026-08-02_15-22.jpg (28 KB, 384x316)
28 KB JPG
>>109439154
>>
>>109438660
no that's pure cpu.
i could have used opengl/glx but wanted to make something simple.

if you want to use opengl, i think the best solution is glew, you'd likely not use xlib drawing primitives that are incompatible with most opengl-based pipelines.
basically glew handles the boring os/gpu specific init, and gives you os-agnostic events and functions (similar to sdl, but lighter).
>>
>>109439457
meant to reply to
>>109438724
>>
>>109438643
this, i use a similar feature from nvim and it's godsend. my text editor is my file manager,
everything is a buffer
>>
File: bho72gfg6lfz.png (77 KB, 608x472)
77 KB PNG
This whole thread is a fucking bloody cautionary tale alright.
>>
>>109438754
That's only if you reallyneed native apps.
Electron is unironically an alternative for desktop apps. It's good enough for almost everything.
>>
File: MonsterGirlDoctorKINO.jpg (337 KB, 1920x1080)
337 KB JPG
>>109438028
Imagine caring this much about useless and meaningless gui toolkits and thingamahjigs when you could instead be watching some sweet kino moe like picrel.
Couldn't be me.
>>
>>109438712
>For renaming, it's a lot more dangerous if you can't see the changes before applying them.
>>
>>109440368
NTA but I once did
rm -r ./prefix *

instead of
rm -r ./prefix*

And it deleted everything in my current directory, luckily it wasn't anything of importance, but I almost shit my pants when I realized what I had done, anon is right, using GUI is safer but it's slower and lot more inconvenient for me that's why I prefer CLI
>>
>>109440427
Deleting shit in current directory seems to be a common problem.
One time I was using a zipped (no install) version of Steam. It came with an uninstall.exe. I put some yarr'd vidya in the same folder. Ages later I didn't want it anymore so I ran the uninstaller. It nuked the entire directory.
Was clearly a bug, but didn't care enough to report it.
>>
Try a video game engine
>>
>>109438028
>Yeah, that's the last resort. I'm really starting to believe WinAPI is the best Linux GUI toolkit...
Or you can always use .NET with Avalonia.
The pricing shit is for if you want support and extra tooling
https://github.com/AvaloniaUI/Avalonia
It shows as MIT licensed.
>>
File: X.Org_Logo.png (81 KB, 1280x1025)
81 KB PNG
>>109438404
>Holy shit, you CAN do that?
Yes, X11 was meant to be effectively a "Desktop Environment", where you pick the shell you want, compositing you want and applications you want. that's what "Window managers" are A GRAPHICAL SHELL despite having the wrong name.
It was the closet thing to a unified graphical unix (was it good, not really it had it's many flaws, could these have been fixed? Yes). Gnome+KDE group also known as "FreeDesktop" Actively killed it. especially gnome doesn't want a unified Linux desktop it wants gnome to be that desktop.
>>
>>109440786(me)
>especially gnome doesn't want a unified Linux desktop it wants gnome to be that desktop.
And I want to add to that where do you think the extremely anti-kde stuff comes form? The gnome community, does KDE have flaws - yes? i.e...
- the toolkit license
- quality of the code
- and despite having a lot of bells and whistles it doesn't have much real features
- suffers form being a linux/Unix Desktop and it's design flaws.
- UX issues (Don't let yourself get fooled by propaganda UX isn't UI you can have a 'bad' UI yet still have good UX (Windows in many areas, example getting a message when something crashes or errors or needs to be activated, the user now knows what to do).
but UI design isn't it, that's a fucking retarded argument.
It's just Gnome & it's community actively trying to dismantle KDE.
It's something they do with other Desktop like Cinnamon/Linux Mint.
>>
>>109439123
Apparently lots of people and somehow nobody is running rm -rf /usr. Because if they were they'd be the kind of retard to post here.
>>
Motif, or fltk or imgui
Motif is great and hasnt changed in 25+ years (a good thing!)
>>
>>109438028
>What the fuck do I use if I want to make a GUI for my program?
TCL/TK. Only your pride separates you from success and peace.
>>
>>109441558
I don't like how motif hijacks the event loop. I wish it would play nice with eg epoll.
>>
>>109438040
Avalonia will be PayToWin very soon
They turning into unity for sure
>>
>>109439486
yeah + you can use all the plugins of your text editor; fancy multicursors, text snippets, autocompletion and the likes. it's just game changing.
>>
Fox, the toolkit that everyone forgot because muh windows looking.

https://en.wikipedia.org/wiki/Fox_toolkit

XFE, the best and most Unix of all graphic file managers is using it

http://roland65.free.fr/xfe/index.php?page=screenshots
>>
>>109438028
wxwidgets you dumb nigger



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.