Nana C++ Library / Blog: Recent posts

Demo: Creating A Simple Notepad In Nana 0.7.2

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.

Get Started

First of all, the whole program code is ready, and then we will go through each function.... read more

Posted by Jinhao 4 days ago Labels: C++ C++11 GUI Nana Modern C++ Style

New Features in 0.6.3

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.

Place Example

The div-text might look like this.Full example is here... read more

Posted by Jinhao 2014-04-08 Labels: C++ C++11 Nana GUI

Nana Documentation Wants Your Help

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 cnjinhao@hotmail.com, I am looking forward to it.

By the way, a new domain for the project is working now.
http://nanapro.org

Regards!
Jinhae

Posted by Jinhao 2013-12-15 Labels: C++ C++11 Nana

What's New In 0.6

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

Posted by Jinhao 2013-12-14 Labels: C++ C++11 GUI Nana

An Introduction to The Image Processing Interfaces

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

Posted by Jinhao 2013-05-17

Why should not a widget be copyable or movable?

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.

Complexity

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

Posted by Jinhao 2013-05-14

Nana Tutorial: Creating A GUI Calculator

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:

Screenshot of Calculator

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/)
Posted by Jinhao 2013-03-03 Labels: C++11 Nana GUI

Preliminary Study of Nana C++ Library

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

Posted by Jinhao 2012-11-21 Labels: C++ Nana GUI