Question:
How does one go about programming even a simpler desktop application like Notepad?
anonymous
2018-12-11 19:49:10 UTC
I have experience programming in several languages, such as Python, Java, and C++, but I still don't really know how I would create a finished product such as Notepad or Word or whatever. I'm less concerned about the specific logic with respect to text editing done, but rather the entire program, with the toolbar (File, Edit, View, ...) and also being able to just open the program through the .exe icon, etc. I just chose Notepad as a simple example, but I'm just as interested in stuff like Spotify, web browsers, etc.
Three answers:
husoski
2018-12-11 21:16:55 UTC
That's a Graphical User Interface (GUI) that you're talking about, and those are complicated enough that applications depend on libraries of pre-written code, If the library is large enough, and includes most of what you'll need to write an application, it's commonly called a "framework".



Java has two standard frameworks to choose from: Swing and JavaFX. You can learn about those in the graphical user interface trails at the Java Tutorials site:

https://docs.oracle.com/javase/tutorial/



Python has a number of choices, but the first should usually be tkinter. This is a Python interface to a GUI library (called Tk for "toolkit") designed for an entirely different language (Tcl). The tkinter package (capitalized as Tkinter in Python 2) is included with every standard installation of Python. There's no single, complete reference for it in Python terms, but the following site has a pretty good tutorial:

https://www.python-course.eu/python_tkinter.php



C++ has no standard GUI. It's got a very low-level standard library with no support for anything outside the program other than a file as a stream of bytes or characters. You need to look outside the standard language. Two popular portable (Unix/Linux, WIndows, MacOS) choices are Qt (pronounced "cute") and the fully-free and open-source GTK+. I haven't tried them, personally, so I can't recommend a tutorial. You can get more information at their home pages:

Qt: https://www.qt.io/

GTK+: https://www.gtk.org/
EddieJ
2018-12-11 20:03:36 UTC
I will ask:

If one of your C++ programs wasn't a "finished product" then what was it?



Python and Java will often be run without having a .exe, but a C++ program is usually turned into a .exe.



Some programs can be executed by clicking on a .exe but may have additional parts, often .DLLs.



You might need to obtain external libraries that you would use to create a toolbar.



Have you learned to create a GUI? In Java, you would probably have used JSwing for that. Maybe learning about that is what you are missing.



The simple answer to your question is: Do things step by step. Don't try to figure it all out at once. Figure out ONE thing you want to add.
anonymous
2018-12-11 19:58:12 UTC
All of those applications are primarily written in C++.



If you want to get used to UI development, you could try loading up Microsoft's Visual Studio and playing around with Winforms/WPF. They tend to be easy-to-work with interfaces and allow you to understand the basics of UI programming.



Each OS has their own set of APIs to create a GUI. There are some cross-compatible UI libraries (Qt, WxWidgets, etc). WinAPI is what you're probably looking for...


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...