6 ms·
What is the best depends on your exact requirements but three good options to get a GUI off the ground quickly are Tk [1], wxWidgets (and wxPython [2] and wxLua
by networked 10y ago
What is the best depends on your exact requirements but three good options to get a GUI off the ground quickly are Tk [1], wxWidgets (and wxPython [2] and wxLua [3] in particular) and Lazarus (LCL) [4].
Tk widgets look native on Windows and macOS (if you use the right ones — see [5]), though their behavior is implemented by Tk itself. On Linux it draws its own widgets in several styles; GTK and Qt theme support is immature. Lazarus and wxWidgets use native widgets on Windows and macOS. Both can use GTK2 on Linux but Lazarus also supports GTK1 and Qt.
If I had to deliver a cross-platform desktop GUI application by midnight today, I would go with Tk, write the code in Tcl (which necessarily has the best Tk integration) and package it in a static binary Starpack [6].
[1] http://www.tkdocs.com/ http://www.tkdocs.com/
[2] https://wxpython.org/ https://wxpython.org/
[3] http://wxlua.sourceforge.net/ http://wxlua.sourceforge.net/
[4] http://www.lazarus-ide.org/ http://www.lazarus-ide.org/, http://wiki.lazarus.freepascal.org/LCL http://wiki.lazarus.freepascal.org/LCL
[5] http://www.tkdocs.com/tutorial/idle.html http://www.tkdocs.com/tutorial/idle.html
[6] https://tcl.wiki/Starpack https://tcl.wiki/Starpack
- witty_username 10y agoTk is antiquated (no antialiasing [1]) and has a poor look on Linux. It lacks functionality in widgets such as embedding a progressbar in a tree/list (don't remember) widget, which Qt supports. Also, poor font rendering support. (doesn't render Devanagari and probably CJK scripts). It feels like a 10 year old tech which it is. (1) Maybe there is some option for it somewhere, but if so, having antialiasing disabled by default is weird.
- jrapdx3 10y agoSuitability of Tcl/Tk depends on what the goal is. For some applications, like utilities, GUI access to CLI tools, form-based data entry, etc., Tk is fine. It isn't a good option for a sophisticated drawing program, and I would try to use it for a full-bore word processor. Within its domain, Tk is a very capable tool that easy to use, well-documented, versatile and relatively bug-free. Future versions are planned to acquire antialiasing and other improvements, no doubt it will be a while before it's available.
- rer 10y agoFrom what I'm reading in this thread, Tk is out of the question. Poor antialiasing sounds like bad looks.
- auriocus 10y agoI don't understand how anyone can assume that antialiasing is missing in Tk, it's simply wrong and has been there for many years for font drawing. On Linux, it must be compiled against fontconfig/xft (default, if the headers can be found). On OSX and Windows, it uses the native font renderer. The only point on OSX high dpi displays: you need to set a property that the application supports high dpi (in a .plist file), but this holds for any App-bundle on OSX. Antialiasing on a canvas (as opposed to text in labels, buttons etc.) is only enabled in OSX by default. tkpath replaces the default canvas with a more complete implementation (alpha blending, gradients, antialiasing...) on all 3 platforms.
- rer 10y agoThanks so much for this! I know very little about Tk. Besides antialiasing on a canvas, does antialiasing also work in text in labels, buttons, etc? Can I get in Tk all the fonts I can get in a Mac? Is Helvetica there? Why can't I find on the web screenshots of Tk apps running on Mac OS X? Is the only way to get Tk to look good on a Mac using Tile http://tktable.sourceforge.net/tile/screenshots/macosx.html http://tktable.sourceforge.net/tile/screenshots/macosx.html ? From what I'm reading now there might be 4 options: Tk, wxWindows, QT, and a custom "thin layer".
- networked 10y agoThe link [5] in my top-level comment plus http://www.tkdocs.com/tutorial/fonts.html http://www.tkdocs.com/tutorial/fonts.html should answer your questions. The former has screenshots of Tk on macOS and discusses how to make it look good there. There is a screenshot of a commercial Mac application built with Tk at http://www.codebykevin.com/portauthority.html http://www.codebykevin.com/portauthority.html. Tile was integrated into Tk with version 8.5 (2007). The Tile button, label, etc. are now built in.
- networked 10y agoTk is 25-year-old tech, not 10. ;-) It has also maintained backwards compatibility since 1997 or so, which is a nice feature to have in many cases but comes at a price. For example, you have to know to use a "ttk::button", not a plain "button", to get the native (Windows, macOS) or a least the somewhat better-looking (*nix) widget. The result is that old Tk software still runs unchanged instead of forcing its maintainers to upgrade, but it looks bad and outdated, contributing negatively to Tk's general image. The poor look on Linux is definitely a big downside. You can ameliorate it somewhat with a custom theme [1] but your GUI will still look out of place in any major desktop environment. TileGTK and TileQt [2] aren't maintained. I haven't used it myself, but Tk has at least some CJK support [3]. One thing to keep in mind from the start, though, is that Tcl/Tk suffers from a UTF-16 code unit limitation similar to Java's; it only handles the Basic Multilingual Plane [4] natively. As for antialiasing, what do you mean when you say it is disabled by default? Is that in a particular Linux distribution? A recent Tk release (post-Tcl 8.5) should render antialiased text unless you compile it with "--disable-xft" or your font is raster. [1] E.g., http://chiselapp.com/user/skoro/repository/tclapps/artifact/f94de4d27365ba49 http://chiselapp.com/user/skoro/repository/tclapps/artifact/.... [2] http://www.tclcommunityassociation.org/wub/proceedings/Proceedings-2010/GeorgePetasis/TileQtAndTileGTK.pdf http://www.tclcommunityassociation.org/wub/proceedings/Proce... [3] Per https://tcl.wiki/CJK https://tcl.wiki/CJK. [4] https://en.wikipedia.org/wiki/Basic_Multilingual_Plane https://en.wikipedia.org/wiki/Basic_Multilingual_Plane
- witty_username 10y ago> As for antialiasing, what do you mean when you say it is disabled by default? Is that in a particular Linux distribution? A recent Tk release (post-Tcl 8.5) should render antialiased text unless you compile it with "--disable-xft" or your font is raster. Sorry, I was thinking about antialiased drawings (canvas). Text was antialiased if I remember correctly. IIRC Tk only has linear gradients, no fancy gradients that is needed to make your GUI look good.
- mintplant 10y agoLast time I tried wxPython (a couple months ago) the installer was broken on Windows.