lainchan / λ
Desktop programming
Chan Siu Ming · 2017-05-22 20:14
Talk here about desktop applications, GUI frameworks, cool libraries, favorite languages, projects you're working on and all things desktop programming related!
Also, remember that the deep black gaze of the universe laughs at people who get annoyed over other people's preferences! Use honest and direct arguments like the big boy/girl you are!
Judge Fang · 2017-05-22 20:35
I want to modify the windows 10 taskbar functionality to add centering (not the fake way with empty folders). Does anyone know how I can go about doing this? I looked into the xml files for start menu/taskbar, but they're no good for this. I'm a bit of a noob when it comes to windows programming.
idk · 2017-05-22 22:55
>>1405
why not use linux which is built for this kind of customization?
windows isn't, which usually means you have to do really hacky things to get stuff like that to work.
even the windows 'multiple desktops' thing is buggy, it wouldn't let me open multiple insteances of the same application in different desktops for example.
Splicer · 2017-05-22 23:51
Lately I have the urge to make a new desktop environment for GNU/Linux. I would want something written in C and can be extended with GNU Guile. Not really sure how to approach this as I have no clue how desktop environments work.
Appleman1234 · 2017-05-23 01:36
>>1412
I suggest looking at other people's prior art.
Specifically based on what you have said so far checkout https://github.com/vurtun/nuklear to use as a GUI library.
See the entries written in C in https://en.wikipedia.org/wiki/Comparison_of_X_Window_System_desktop_environments for a starting point regarding desktop environments, and https://www.gilesorr.com/wm/table.html and https://en.wikipedia.org/wiki/Comparison_of_X_window_managers for stuff on Window manager's specifically.
Also see the following stackoverflow posts
https://stackoverflow.com/questions/1811321/building-a-window-manager and https://stackoverflow.com/questions/3472540/creating-a-window-manager-for-linux and
https://stackoverflow.com/questions/4001892/how-to-create-a-simple-desktop-environment
https://unix.stackexchange.com/questions/20385/windows-managers-vs-login-managers-vs-display-managers-vs-desktop-environment.
In terms of the smallest lines of code examples to go look at, see http://incise.org/tinywm.html for a tiny window manager, and see
https://www.openhub.net in order to search through the list of desktop environments and get Lines of code count. Doing this with some of the entries from Wikipedia gets me
https://www.openhub.net/p/simple_de at 104K lines of code and https://www.openhub.net/p/LXQt at 169K.
For an alternative minimalistic approach then see Oberon, http://www.projectoberon.com/ and https://www.youtube.com/watch?v=EXY78gPMvl0 and http://oberonstation.x10.mx/ and see the following paper and STEPS, specific Ometa (which was succeeded by ohm), and KSworld and Nile, for an example of using DSLs and meta compilers to reduce the line count of operating systems and desktop environments
http://www.vpri.org/pdf/tr2007008_steps.pdf and
http://www.vpri.org/pdf/tr2011004_steps11.pdf and
http://www.vpri.org/pdf/rn2010001_programm.pdf and http://www.vpri.org/pdf/m2013003_ksapps.pdf
and https://github.com/damelang/nile
and https://www.youtube.com/watch?v=P97O8osukZ0 and see
http://www.vpri.org/vp_wiki/ for further information.
I recently switch to Lumina from KDE 5 Plasma, and I am enjoying the shift despite the fact that they are still in the process of writing their own window manager (fluxbox is used as a placeholder) and that other supporting applications for certain interactions (stuff like network management, power management and bluetooth,etc) haven't been written yet or haven't been written with the same level of functionality I am used to.
Rick Deckard · 2017-05-23 09:08
>>1412
I haven't heard of any WM or DE that's extensible with Guile, I think.
If you want to try writing a WM yourself, there's a pure Guile library generated from the X protocol definition (the same way libxcb for C is), so you could write completely in Guile.
I suggest you look at tinywm, catwm and dwm for some examples.
Lord Nikon · 2017-05-23 16:24
>>1405
>>1410
React OS says hi
Lukasiewicz · 2017-05-24 12:52
>>1405
If you don't mind using something other than Explorer, you could use bbZero. It's very heavily customizable.
H.R. Giger · 2017-05-24 16:28
>>1422
there is a guile extensible WM, but it's not mantained nor usable (and buggy).
But >>1412 could use it as a basis or whatever.
It too depends on what kind of DE he wants to do. Windows style, with fancy bars and little icons?
By the way, here's guile-wm:
https://github.com/mwitmer/guile-wm
Case · 2017-05-24 17:13
Let's say you're making a program to manage personal finances in Rust (or a to-do app, calculator, whatever you prefer). What would you use for the GUI in linux?
I work basically with back end webdev and i have no clue on how to do this, even though i'm really into Rust.
Incognito · 2017-05-24 21:05
>>1438
Have you come across ledger or hledger?
They're both programs for managing finances, and the user interface is just a text file containing a record of your transactions (hledger also has an interactive command-line interface to add new transactions). It's very simple but, because it's so simple, it's also really nice to use.
Always try the simple thing first.
typedef · 2017-05-24 21:13
>>1438
There's probably a qt library for it
HELIOS · 2017-05-24 21:39
>>1441
That isn't the point, Lain. The point is to learn rust + do something remotely useful for me personally.
cdr · 2017-05-24 21:59
I'm looking for a cross-platform API to write an editor for my game engine, but I'm still unsure if I should use Qt or GTK. Heck, I'm even unsure if I should use C.
Any lainons can recommend me anything?
>>1412
If you start such a project, you'll have my axe. I've also been experimenting with GNU Guile and I'm wondering what could be done with it.
It'd also be cool to see a DE mixing with concepts from the old LainOS thread before the server got fuarrrked up, such as an AI assistant with opt-in distribution, and I really think Guile is the way to extend a DE for something like this.
Spike Spiegel · 2017-05-24 22:43
>>1444
crossplatform anything defaults to Qt with me, honestly.
GTK is a mess to program and not nearly as crossplatform as Qt.
Before C++11,14 an 17, Qt was the only way to make C++ great again.
bit · 2017-05-26 01:05
If I can program command line programs, how do I get over my fear and make a graphical one?
Random · 2017-05-26 01:41
>>1455
Pick a GUI library, learn the basics and do your stuff, man. Ain't much different.
Donna Hawthorne · 2017-05-26 17:06
>>1455
Make something simple with tkinter. Every library you learn after tkinter will be so much easier you won't worry about learning stuff ever again
cdr · 2017-05-26 17:12
>>1463
I've never used Python before, but I suppose now would be a good time to learn. I quickly read about tkinter now: why not just use tcl/tk?
x<->y · 2017-05-26 17:30
>>1464
Tk is not bound by Tcl in any meaningful way, it's a C library so using it with Python is just as normal as using it from Tcl.
Tcl is kind of dead and it works in a different way compared to most languages, so if you're just starting out you might find it harder due to the lack of documentation, and you might not get that much out of it.
McCarthy · 2017-05-26 19:25
>>1410
I use windows for gaming and lighter programming like java. I have cygwin for any unix- like needs i may have, but I'm still very comfortable with macrosoykaf windows. I use centos for my research though. I just want to learn to develop soykaf on windows/ modify windows. fuarrrk the windows api though.
Eldon Tyrell · 2017-05-26 22:45
>>1470
>lighter programming like Java
I don't quite get it...
Not gonna push the topic forward given your preferences, but modifying everything is also a Linux thing, more than Windows. You'd just need a little time to get used to the system, that's all.
Personally, the lack of freedom and the slow speed of Windows is excruciating for me, every time I boot it up to do something I can't on Linux. But that's because I got used to it.
Wirth · 2017-05-26 23:38
>>1475
Lighter was a bad word to use there, I pretty much mean it's super easy to work with java in windows compared to working with c, especially given that all C programming i have done is in linux. I wouldn't have all the libraries i need
Case · 2017-05-30 15:02
>>1476
you can use java on linux
H.R. Giger · 2017-05-30 15:58
>>1476
You're probably mistaken lainon, most programming languages are easier to mess with on a Linux environment, and C can be easy to use on Windows, for a beginner programmer, if he/she uses something like Code::Blocks + MinGW.
I'm not gonna pretend I'm a Java expert, but you'll never miss Java IDEs on Linux too. There's good old Eclipse, NetBeans, IDEA or even Android Studio for your Java and Kotlin needs. As for if you're unsatisfied with OpenJDK, you can always install proprietary Oracle JDK.
You can also use Clojure/ClojureScript in a much easier way, if you're also a fellow lisper. Just install the packages and you're ready to go.
Aristóteles Amadópulus · 2017-05-30 16:53
>>1410
my two problems with linux are wine and the fact that whatever distro I have seems to just break after a few months of moderate usage. I can get over these, but having to dig through google and my terminal just to get my computer to work again every month or so can be very annoying.
Chan Siu Ming · 2017-06-01 03:58
>>1548
I think it's just an experience thing.
I used to have these issues when I started out. Linux got better at supporting common hardware and I got better at fixing Linux issues. I've been running the same Arch install on my laptop for about three years now no problems.
I agree the terminal can be frustrating when you start. If you don't learn to like it, you will not enjoy Linux.
Jane Doe · 2017-06-02 22:51
I'm consistently amazed with how every modern platform I'm aware of makes it unnecessarily painful to write a graphical program.
Marrying GTK, QT, or another toolkit is hardly appealing. Tk is the only language I'm aware of that attacked this issue head on, but it had various other, serious issues that killed it. Languages also try to be very platform independent and choosing a certain graphical style can severely hinder that.
I'd like to have an independent graphical area with the following: nice text capabilities, including fonts, sizes, colors, foregrounds and backgrounds; the ability to draw to the area in arbitrary ways; mouse support; and simple sound support.
It really seems that the easiest means to achieve all of this is to piggyback on another program that already has all of this, such as Emacs. What do you think of this right mess?
Mario Rossi · 2017-06-03 03:37
>>1599
Try fltk. It doesn't look native, so don't even try to pretend like it's a normal qt or win32 app. But if you do custom gui work, it's very, very, very much what you're looking for.
Don't look at the fltk page for examples, they suck. Check out non-daw for better examples: http://non.tuxfamily.org/wiki/Screenshots
You can draw anything you want, and style Fltk to look very nice, but you'll have to roll up your sleeves and get to work. It doesn't look that slick out of the box.
But it's way easier than writing your own whole GUI framework on top of a drawing lib like SDL, or trying to do a custom GUI with Qt, which I mean Wt is fine, but there's just a lot more hoops to jump through and things to understand.
The Phantom Phreak · 2017-06-03 04:52
Does anyone know some nice programs for tiling on macOS? I'm trying to rice my desktop but so far this is a field I've had very little luck with.
null · 2017-06-03 06:07
>>1604
there's kwm, which in my experience requires a good deal of configuration because not everything likes being tiled (system preferences, popup messages, etc)
https://github.com/koekeishiya/kwm
you can use it with nerdbar if you're looking for a topbar replacement
or if you feel inclined to do so, write your own with hammerspoon
Special Agent Bob · 2017-06-03 15:18
>>1604
>>1605
kwm is fairly nice, but some things definitely don't play very nicely with it. I've found that the workspace changer often seems to get confused with which windows belong on which workspace, and so they'll sometimes teleport (or the same window will appear on multiple workspaces). Sometimes it just doesn't tile a new window and I have to restart it to fix that.
But on the whole it works pretty well.
Lukasiewicz · 2017-06-04 04:38
kwm was what I was using but I didn't particularly like it. I didn't spend too much time fooling with settings before I gave up on it so I guess I'll go back and give it a second chance before making up my mind.
FILLER · 2017-06-04 10:18
I actually came to this thread to post that I made my first gui app by writing a tcl/tk wrapper around a c++ program that I made.
Next I wanna pick up on qt and sdl.
Donna Hawthorne · 2017-06-06 15:39
relevant: https://youmightnotneedelectron.com/
Von Neumann · 2017-07-15 03:21
>>1414
Thanks for the links, will definitely go through them.
>>1422
>there's a pure Guile library generated from the X protocol definition
Yes, I've heard of it, I was thinking of checking it out to see if I can use it.
>>1444
Sure, I definitely want to experiment with new concepts. Would be great if the extendability makes it even easier to experiment.
John Peters, You Know, The Farmer · 2017-07-28 19:09
A project I've been thinking about recently is a fast, lightweight calculator app in C/C++(with functionality similar to a TI-84. Not too complex like the TI-89 but has a lot of useful features for day-to-day calculations)
What GUI frameworks would you recommend? I've been looking into the FLTK, but I'm open to suggestions.
Dox · 2017-08-30 06:40
Can someone give me some direction on GUI programming? I've been programming for a few years now, but i've never had the need to create a GUI from scratch. While researching about it for a personal project, i got really confused. Odd as it may seem, there's an incredible lack of documentation about most GUI libraries, it's as if everybody knows about it and i missed the memo.
I'm trying to do a very, very simple program for personal usage, i'm trying to find a library or framework that allows me to customize a native piece of software as much as CSS allows for HTML customization. Language isn't important as long as the library/framework supports linux, since this is a small personal project, what's important for me is not being stuck with the native OS look and feel.
I feel awfully stupid after researching for hours and being unable to display 2 tabs on the screen.
Kay · 2017-08-30 07:47
>>3121
Im a bit confused by your statement.
Usually when someone asks about GUI, my default is to point them to the Qt toolkit which stated as GUI framework but today is much, much more. But still as easy to use and very powerful.
What puzzles me is this statement:
>that allows me to customize a native piece of software as much as CSS allows for HTML customization
Native software usually has no html or css unless its a browser. Do you mean web-based software maybe?
Pulse · 2017-08-30 13:02
>>3123
Not really, i only referred to CSS as a parameter of what i'm looking for. Tkinter, for example, seems to be fixed on the native appearance of whatever OS you're using, i couldn't create Skype on tkinter if i wanted to. What i'm looking for is the freedom to customize the look and feel, besides just splashing information on the screen.
ps. Maybe it is possible to customize tkinter to such a degree and i'm just uninformed. I couldn't find anything though.
Lunch · 2017-08-30 14:03
>>3125
I don't think Tk gives you so many options to customize the style. You could try with this http://www.tkdocs.com/tutorial/styles.html
If you want to customize stuff more you should probably use something more powerful like Qt, but I imagine that it wouldn't be very easy for a beginner.
Marly Krushkhova · 2017-08-30 14:29
>>1410
>I want to do X with windows
>Haha, why don't you use linux :DDD
Fuсking retard(Avoid using personal attacks.)
Lord Nikon · 2017-08-30 16:14
>>3125
oh, now I get it.
Yeah, you should definitely use Qt, it was what they used to make Skype actually.
It supports the native look and feel of every platform its on (Linux, Windows, Mac, Android, Meego, Sybian, QNX, VxWorks, Blackberry...)
Neo · 2017-08-30 17:49
>>3125
People normally want all their native apps to look the same, which I guess is why documentation does not mention how to do this very much. I would be surprised if QT cannot do what you want though.
Yu-ichi · 2017-08-30 17:57
>>3128
I read it more like
>I want to make a pyramid shape from a sheet of glass
>That will be difficult, why don't you use clay?
word · 2017-08-30 23:10
>>3130
Thanks, another question that i don't seem to be quite getting. Often times i hear about people using Qt to create just the interface. How is that possible, do they add the binaries to do other kinds of processing and call them from Qt?
For example, let's say i'm using Rust to do heavy processing and c++ Qt to create the interface, whenever something does not rely on interface, would i call my binaries from the Qt c++ interface directly?
This is a concept that i never quite understood.
roll · 2017-08-31 03:50
>>3138
>This is a concept that i never quite understood.
Because its pretty stupid.
Unless you really need some ultra-specific function, you should write the rest of the application, particularly the heavy lifting parts in C++, or even better: In Qt which is technically C++ however it differs quite a bit from vanilla C++.
Usually in the scenario you mentioned the actual application is either a library which is then linked against the UI, meaning the UI just calls functions from it and passes parameter and returns results. Or its some sort of Server/client setup whith the GUI being the client. Message passing can be done network-transparently, meaning it does not matter if the server runs on the same machine too or on one halfway across the world.
list · 2017-08-31 08:25
>>3138
>Thanks, another question that i don't seem to be quite getting. Often times i hear about people using Qt to create just the interface. How is that possible, do they add the binaries to do other kinds of processing and call them from Qt?
Other way around. Qt is a library, which means it is not an executable binary by itself. You will always need to write your own main function, and then call Qt functions from there.
Since Qt is written in C++, it is easiest to write your program in C++ just so you can work with Qt. However, software libraries usually have something calling bindings, which is glue code that lets you call the library functions from programming languages other than C++.
Here is some information on bindings for Qt
https://wiki.qt.io/Language_Bindings
I hope this is helpful.
Junichi Fujiwara · 2017-08-31 14:14
I actually prefer gtkmm to Qt
Moore · 2017-09-02 00:05
>>3132
I still don't know how to make my glass pyramid :/
St. IGNUcius · 2017-10-07 13:40
Why is it so damn hard to make GUIs? Tkinker is the only approachable framework, and even then you can't customize appearance.
The other option is electron, and god forbid using electron for simple applications.
It looks like something so essential for almost any application. It feels like i've missed something in my education that everybody knows about.
Gyula Kovacs · 2017-10-08 04:08
>>4159
there's gtk or qt ? as for tkinter, you can customize appearance to a certain extent
http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/ttk-themes.html
the docs are lacking but most things are doable
win32 · 2017-11-02 01:49
>>1405
inject a dll into explorer.exe, use spy++ to find the window corresponding to the task list by window/class name (FindWindowPos). i've done it for you, it's either "ReBarWindow32" or "MSTaskListWClass". then use SetWindowPos on the handle you get to change the x position to a value that you've calculated after querying the position of other elements on the bar
Pris · 2017-11-02 02:48
>>4159
I found FLTK with FLUID to be relatively easy to use. You use FLUID GUI to design the GUI, so that is super easy. Then, you add events and callbacks to link it to your code. Finally, you can statically build it, which is nice since you won't need FLTK .dlls everywhere.
Unsigned · 2017-11-09 22:18
>>4669
reading through the api, it seems that that function only changed the window's position, not the position of its button on the taskbar. although after reading through the api, it looks like i need to modify shell32.dll, not explorer. shell32 implements the ITaskBarList interface so now i need to find out how to modify that
win32 · 2017-11-20 00:24
>>4864
in Windows everything is a window including buttons and other controls. they all have handles
Agent Smith · 2017-11-20 00:51
>>4159
This was mentioned in the GUI thread ( >>5061
), but tbe view dialect in the REBOL family languages is a standard that every modern GUI library should aspire to imho.
dup · 2017-11-20 02:12
>>5112
I haven't learned anything about the windows api so I didn't know that, thanks. I cracked open spy++ to look at it myself and see what you mean , thanks! Excuse me for being so naive
Agent Richard Gill · 2018-02-10 15:24
The Haiku native gui API is one of the nicest I've used (if you're writing C++, there's a severe shortage of bindings to other languages though).
For everything else, I'd always go straight to qt.
Y.T · 2018-07-09 21:01
Where should I start trying to write a window manager for Windows?
St. IGNUcius · 2018-07-10 23:39
>>9394
virtuawin.sf.net is free software; why not start by looking at how that works
XERXES · 2018-07-10 23:57
>>1403
i'm making an irc client for windows using github.com/lxn/walk
it's usable as in i'm using it right now and i'm trying to keep it simple, lightweight, and fast (as in responsive to keyboard input there's nothing more frustrating than typing in an active chat and not seeing your words show up for 5 seconds) while also supporting a feature set on-par with every other client out there (highlights, scripting, all the typical ui nice-ities) but there's still a lot of work to be done with every item i knock off the to-do list about 10 more appear and the end result will still be mediocre at best because the windows api is soykaf
still it's interesting and I'm learning a lot of (potentially useless) new information. being a recovering websoykaf i find it therapeutic and after not coding anything for a year at least it's nice to derust my ability to vim
visually it's unremarkable (default windows styles... bleh) and I went to these pages: enwp.org/Lists_of_colors and literally did a ctrl+f for "red", "yellow", well those are 0xff0000 0xffff00 but like magenta cyan okay those are easy too shut up the point is my colorscheme is hideous atm i don't want to show you but if you find me in the wired maybe we can ... i have to go now.
Guthrie · 2018-11-07 19:56
>>1599
Try Nana: nanapro.org
Easy to use, opensource and works on Linux / Windows / Mac
Anonymous · 2018-11-07 21:10
>>5112
OMG. This explains just about everything about why windows is like kicking dead whales down the beach.
Batou · 2018-11-08 00:15
I want to make Game Of Life in WPF+C#. I have grid with buttons, and they change color after click, now i need to implement rules and main function button. Function probably will be while loop - inside: check every On button if it fulfill rules (check state of buttons around it with help of some iterator variable) and then change button or leave it again. Grid is not infinite so it may crash if some cycle meets borders, and also i need to differentiate between buttons on the borders, and butttons on middle, but i dont think all of t sounds so difficult. I am really happy that i started, because i was afraid of WPF and XAML in general, but it appears you make grid with just C# for loop and (i,j) coordinates, and you dont need to know XAML syntax at all. Any hints?
dictionary · 2018-11-19 11:33
>>1599
In my mind that's what html is for, and if I'm not mistaken gui design tools for gtk and qt export something like html
Six · 2019-07-30 14:45
wxwidgets is the best guuuey library!