V—A Free C++ GUI Framework for X
I love Linux as a development platform—it has all the Unix tools I've been using for years. Linux has been a superior development platform in every way except for development of graphical user interfaces (GUIs) with X. For some time, programmers using Microsoft Windows have had the option of using either Microsoft's MFC or Borland's OWL to develop C++ GUI applications. However, Linux has caught up in the graphics area as some very good freeware C++ GUI frameworks are now available for X and Linux. This article is about V, the GUI framework I've written.
I first developed V as a tutorial example for a C++ book I'm writing. My tutorial has turned into a very complete, easy-to-use C++ GUI framework suitable for developing almost any GUI application. It works with X and Linux, and uses the standard X Athena toolkit, so that everything remains free. V uses some customized versions of the free Athena 3D widget set, so V applications have a very handsome 3D look. V also works with Microsoft Windows, so applications you build on Linux with V are easily ported to MS-Windows, as well as other X platforms. V is distributed under the GNU Library General Public License, so you can freely use V to develop either other freeware or proprietary applications (as long as you make the source of V available to the end user).
Two other good frameworks are wxWindows and YACL. While these two programs have their strong points, I think V is much simpler to use and has applications that are more user friendly. For more details, a comparison of V and the other frameworks is posted on my web page (http://www.cs.unm.edu/~wampler/). All three programs provide much of the functionality of commercial frameworks such as MFC or OWL.
If you don't use a GUI library or framework, you are stuck using the native X toolkits to develop your GUI, either by using X directly (very hard) or using the Xt Athena or Motif widget sets (just a bit easier). While you can develop very nice interfaces using these toolkits directly, there is a steep learning curve. A good programmer needs at least a month of steady effort to be able to write programs using either Xt Athena or Motif, and the applications are limited to X platforms. One of the problems with the native X toolkits is that they are designed to be totally flexible, and to handle almost any interface design. This very generality makes them hard to learn and to use. For most applications, you simply don't need that much flexibility.
V, on the other hand, has been designed from the start with ease of programming in mind. I have received reports from new V users saying they were able to get their first V applications up and running in just four or five hours from downloading the V distribution to ending with a running application. Within a week, programmers are able to fully use almost every feature of V. Even the inexperienced programmers in my classes at the University of New Mexico have learned to program with V in a week.
The cost for this ease of programming is rather small. For one thing, you must use V's definition of the GUI elements. When you use V, you end up with interfaces that conform closely to standard Motif or Microsoft Windows applications. Also, you lose some of the low level access and flexibility you have when using the low-level toolkits. For the vast majority of applications, this loss is not significant. V does provides hooks for getting at some of the low-level details, but the only use I've heard made of them is to interface with OpenGL and Mesa.
Figure 1 shows the V Icon Editor included with the V distribution. The Icon Editor is representative of a typical V application. The main user interface element is the command window. The command window has a menu bar that is the standard drop-down menu found on most Motif and Windows applications. Below the menu bar are one or more tool bars that allow you to make the most commonly used commands readily available to the user. The current trend is to place buttons with small icons on the tool bar; with V you can use any standard control object on the tool bar. Under the tool bar is the drawing canvas where your application shows data, such as text information, graphical information, or, in this case, the icon to edit. The drawing canvas can have scroll bars, and the user interacts with the data displayed on the canvas using the mouse or keyboard. Below the drawing canvas is a status bar, used to show useful information, like the mouse position.
Dialogs are an important part of most GUI programs. Figure 2 shows the color selection modeless dialog used with the V Icon Editor. V supports both modal and modeless dialogs with a complete set of controls.
I hope you agree that the appearance of this V application is as good as any other X application you've seen on Linux. Icon Editor also compiles in Microsoft Windows without a single #ifdef and will look just like a standard Windows application.
|Non-Linux FOSS: libnotify, OS X Style||Jun 18, 2013|
|Containers—Not Virtual Machines—Are the Future Cloud||Jun 17, 2013|
|Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer||Jun 12, 2013|
|Weechat, Irssi's Little Brother||Jun 11, 2013|
|One Tail Just Isn't Enough||Jun 07, 2013|
|Introduction to MapReduce with Hadoop on Linux||Jun 05, 2013|
- Containers—Not Virtual Machines—Are the Future Cloud
- Non-Linux FOSS: libnotify, OS X Style
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Linux Systems Administrator
- RSS Feeds
- Introduction to MapReduce with Hadoop on Linux
- Validate an E-Mail Address with PHP, the Right Way
- New Products
- Weechat, Irssi's Little Brother
- Tech Tip: Really Simple HTTP Server with Python
- Poul-Henning Kamp: welcome to
37 min 53 sec ago
- This has already been done
38 min 53 sec ago
- Reply to comment | Linux Journal
1 hour 24 min ago
- Welcome to 1998
2 hours 12 min ago
- notifier shortcomings
2 hours 36 min ago
4 hours 13 min ago
- Android User
4 hours 14 min ago
- Reply to comment | Linux Journal
6 hours 7 min ago
8 hours 57 min ago
- This is a good post. This
14 hours 10 min ago
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?