Let's start a tutorial to create a simple notepad, the simple notepad is a text editor allows the user to select and browse existing text files. This example also shows how you can use place, menubar, menu, textbox, msgbox, and filebox and their various options.
This example requires Nana 0.7.2 for C++11 and a C++11 compiler.
First of all, the whole program code is ready, and then we will go through each function.... read more
In version 0.6.3, Nana made a little improvement for 2 new features which can bring convenience for programming.
The Margin Property for Class Place
The margin specifies the empty space at side of the place field.
Hi, guys, Nana now faces insuperable difficulties with too little documentation. It wants your help when you get any thoughts or experience, please write it down, then create demos and articles to help people understand how to use this library.
Send your article to firstname.lastname@example.org, I am looking forward to it.
By the way, a new domain for the project is working now.
1, The Elements
2, Compset and Item Renderer
3, Item Proxy
The item proxy is a basic type that can be used for accessing all items in a container
widget, such as listbox, treebox. Meanwhile, the item proxy is an iterator of the widget,
unlike the STL iterator, the value_type of the item_proxy is itself.
The iterators are a powerful technique and one of the fundamental design patterns. For ... read more
Nana provides a mechanism which can flexibly configure the image processing algorithms. For an abstract algorithm, there would be many implementations. For example, Nana C++ Library provides two stretch algorithms, they are bilinear interoplation and proximal interoplation, you can switch the algorithms under your requirement.
See the example at:
http://nanapro.sourceforge.net/help/paint/image_process_selector.htm... read more
In C++, objects often provide copy ability and moveability to duplicate or move from an existing object. But it was by making a widget copyable or movable caused more problems than it solves.
If a widget could be copyable, what properties should be copied? E.g.
form fm1; button btn1(fm1); form fm2; button btn2(fm2); btn1 = btn2; //Assume that copy is allowed.
We can say that after copying, the caption, position and size of btn1 is same to btn2′s. But, which should be the parent of btn1? fm1 or fm2? and another important question, is a widget reference semantics or value semantics?... read more
Requires: C++11, Nana 0.5
In this tutorial, we will make a GUI calculator with Nana C++ Library. The calculator that we build will look like:
Using nana::gui::place which is introduced into Nana in the version of 0.5, we can create a such GUI easily.
Let's start the code.
#include <nana/gui/wvl.hpp> #include <nana/gui/widgets/button.hpp> #include <nana/gui/widgets/label.hpp> #include <nana/gui/place.hpp>... [read more](/p/nanapro/blog/2013/03/nana-tutorial-creating-a-gui-calculator/)
Although C++ is a powerful and sytnax-agile language, in fact, many programmers don’t like to do GUI in C++, because it is so difficault to make GUI in C++. Some exsiting C++ GUI frameworks define their own rule that makes you write some stiff code for running, it always causes some problems, such as leaving your code in a deep inheritance hierarchy, making maintenance painful. Now, there is an alternative, Nana C++ Library, a pure C++ library that will guide you in doing GUI with your immense and extensive C++ knowledge/skill/idioms, it makes a great progress in doing GUI in C++.... read more