Hello all,
I’m trying to get into GUI programming, but am hesitating on using a Python library to make my first barebones program. My goal is to code basic buttons and understand how operating systems implement the way they draw windows for applications.
I have coded mostly in scientific libraries or high-level languages that are fairly simple (Python, Matlab, Julia)… Also am familiar with basic concepts and syntax from C.
Looking for recommendations to start. I am happy to learn a new PL. Interested in writing code for legacy hardware and mobile. Bonus if the codes are general enough to be written for most displays one could interact with.
I’m going to agree with a lot of the other posters and say QT with QT creator. It’s a tested and well though out implementation. It’s signals and slots event system is straight forward and easy to learn.
Whatever route you take learn Model View Controller (MVC). It gets in the mindset of keeping your data model seprate from things that use the data and things that change the data.
Try egui.
+1 it was a tun of fun for me and rust is great
deleted by creator
This might be of interest for you, and its free PDF. From 2019 but still actual.
An Introduction to C & GUI Programming – the new book from Raspberry Pi Press
I’ve worked with GUIs on python for a couple of years, we used PyQt, which is a python wrapper for Qt which is a C++ library for GUIs. It’s fairly straightforward and easy to get something up on the screen in no time.
However from parts of your comment it seems you want to implement your own graphics library, and that is a lot harder to do.
Also you mentioned legacy hardware, not sure how legacy it would be. Python should run on most things people would call legacy nowadays, but there’s definitely an overhead that could be felt if you’re trying to run this on an embebed system or a REALLY old (as in 90s/00s era) computer.
You also mentioned mobile, I don’t think PyQt can be compiled to mobile easily, nor do I think you should even if you manage to (been there, done that, not a happy time). Desktop and Mobile GUIs are very different, realistically if you want something that works well on both mobile and desktop with the same codebase the easiest approach is web UI.
If you are interested into dipping your toes into rust land there is a library called Iced that I have used before. I at least like it better tham pyqt
deleted by creator
Damn, an actually unpopular opinion
pyqt5 or tkinter
My goal is to code basic buttons and understand how operating systems implement the way they draw windows for applications.
So do you want to program a GUI yourself, and not using a library, correct ?
If you prefer non-kde apps, then consider Vala. It’s a young-ish language and it’s well suited for Gtk apps.
Toga is a blessing. You can make apps for Windows, MacOS, Android, iOS, Linux and Web - all with the same codebase!
If you are in sciences, and happy to learn a new PL, I think you ll enjoy functional programming, even if it is not the most popular way. https://ocaml.org/docs/is-ocaml-gui-yet
I just know I’m gonna get raked, but try Lazarus. A Delphi clone using the FreePascal compiler. Has a framework similar to the VCL, but has pluggable backends. Qt, GTK, Windows, Cocoa, and a native one, though I’m not sure of its maturity. Component programming that is relatively easy to extend.
deleted by creator
I don’t like a lot of python stuff, especially the gui related. flutter (dart) probably the easiest thing I’ve ever used and it works across tons of systems including mobile. Other than that the classic html/css/javascript lol.
Anything that needs big processing of course will suffer with these, I’ve never done that on a GUI though, the backends only.