4 ms·
I understand this, but modularity is one of the philosophies and benefits behind linux, with modularity unfortunately comes inconsistency. As many of the apps a
by grawprog 7y ago
I understand this, but modularity is one of the philosophies and benefits behind linux, with modularity unfortunately comes inconsistency. As many of the apps available on linux are open source and open source developers are mostly free to use whatever toolkits they want or are comfortable with, you're not likely to get the consistency you want with linux.
With windows you have an API provided by windows for ui programs, there will be more consistency between apps because of this.
Linux providing a standardized ui API would go against the core philosophy of it and you're not likely going to be able to convince every developer making gui apps for linux to agree on and use only one graphical toolkit.
Like with anything, every os has tradeoffs and downsides, personally I prefer modularity and control over my system to ui consistency.
- michaelmrose 7y agoActual modularity would imply a common way to plug in different file choosers so you could use file mangager A with desktop b with application from desktop c. Inconsistency comes not from modularity but rather from incompetence.
- tzs 7y agoA standard API can provide more modularity and control than the current approach. You do this by having several available implementations of the API as dynamic libraries--one using Motif, one using GTK, one using Qt, and so on. There would be a per user config setting specifying which implementation the user prefers. If a program wants to put up a file chooser, it can read that, then load the right library and use the API. A program might also have per program settings to override that, to handle the case where a user really does prefer, say, GTK file choosers for most programs but Qt file choosers for some specific programs. This gives you more UI consistency, makes things more modular than having every program include file chooser dialog code, and gives more control to the user, and doesn't interfere with the developer choosing whatever toolkit they prefer for things other than standard dialogs.
- grawprog 7y ago>You do this by having several available implementations of the API as dynamic libraries--one using Motif, one using GTK, one using Qt, and so on. OK, now who's going to do this? At what level would this be implemented at? Would this be at the windows server level? Would I have to pull in GtK, motif, qt and every other library that this API will rely on just to install Wayland or xorg? Will it be at the window manager level? Will I need to pull in GfK, qt, motif etc. for every desktop environment and window manager relying on this API? Which versions of these libraries will this API rely on? The last graphical app i wrote, I used dlangui for a GUI, should I have been forced to use Gtk or qt despite them being heavier and more complicated than what I needed?
- tzs 7y agoYour program in dlangui would do something like this (but in D rather than the C-like pseudocode I'm going to use...). At the place where you want to put up a file chooser dialog, which now presumably does something like this: char * result = dlangui_choose_file(...) you would do this instead: char * result = 0; char * (*standard_choose)() = get_standard_choose(); if (standard_choose) result = (*standard_choose)(...); if (result == 0) result = dlangui_choose_file(...) get_standard_choose is a small function that would: 1. Check a standard set of configuration locations to see if the system administrator or user has configured a standard file choose dialog [1]. 2. If a standard file choose dialog has been configured, the configuration information includes the path to a library that implements it. get_standard_choose() loads that library, gets a pointer to the standard_choose() functions from it, and returns that pointer. 3. get_standard_choose() returns 0 if no standard choose dialog is configured or it runs into problems trying to load it. If the user wants GTK or Qt file chooser dialogs instead of dlangui file chooser dialogs, you don't have to use GTK or Qt. The user installs a GTK or Qt file chooser library and points to it in their standard dialog configuration. (I'd expect at some point that toolkits like dlangui would incorporate get_standard_choose() functionality themselves. After that, you'd then just write char * result = dlangui_choose_file(...) and it would deal with using the user preferred dialog if available. It would be completely transparent to the programmer using dlangui). Same idea for other common dialogs, like color picking, printing, and font selection. [1] Probably something like check an environment variable first. If it doesn't find a match there, probably then a config file in $XDG_CONFIG_HOME. If no match, then something in /etc.