Questions and Answers
Need help? Post your questions here and other people will give you answers.
342
Topics
1.83k
Posts
13
Followers
Yes No
Hide topic messages
Yes No
Enable infinite scrolling
Avice posted Nov 7 at 8:15 pm
Hello,
I create form on Main function.
And try create event on click with thread pool.

nana::threads::pool pool_{ 1 };

nana::button btnupdate(form, nana::rectangle{ 290, 165, 100, 30 });
btnupdate.caption("Update");

btnupdate.events().click([&] {
updater_log->append("\nTrying run", false);
nana::threads::pool_push(pool_, [&]{
upd
0replies
3views
I have a program in where the user "can add music files" by selecting a folder, the contents of the folder are "inserted" in a nana::treebox, and the songs information will be displayed in a nana::listbox.

Each node that represents a music file in the nana::treebox corresponds to an item in the nana::listbox, and a node that does not represent a music file, but the folder in where the music f
2replies
17views
recent by Zeleska  ·  Nov 5 at 1:54 am
Avice posted Nov 1 at 7:51 pm
Hello,
On main() function i create form with widgets. how i can access widget from example function foo()?
I want append text change progress widget value and etc..
If i make form global then i get errors on runtime.

3replies
19views
recent by Avice  ·  Nov 1 at 9:09 pm
Avice posted Oct 31 at 5:47 pm
I cant find what is wrong.
Im using latest nana version, IDE VS2013
Project using v120 toolset.
nana builded with v120 toolset. (compiled successfully, without any errors).
me code:

#include <nana/gui.hpp>
#pragma comment( lib, "nana_v120_Release_x86.lib" )
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{

if (fdwReason == DLL_PROCESS_ATTACH
1replies
14views
recent by Avice  ·  Nov 1 at 5:41 pm
void add_folder(nana::treebox& treebox, nana::treebox::item_proxy proxy, std::filesystem::path path)
{
treebox.auto_draw(false);
for (std::filesystem::directory_iterator dir_iter{ path }; dir_iter != std::filesystem::directory_iterator{}; ++dir_iter) {
treebox.insert(proxy, dir_iter->path().u8string(), dir_iter->path().filename().u8string());
}
treebox.auto_draw(
5db6854b0d1ee.png
4replies
24views
recent by Zeleska  ·  Oct 29 at 6:11 am
I have a property grid that contains properties ( name value pairs ). In the simplest case, a single property is displayed as a label ( for the name ) and a textbox ( for the value, which can be edited by the user ) displayed on a panel. The panels for all the properties are displayed in a panel with scrollbars.

This code:

form fm( 0, nana::size{ 400, 600 } );
fm.caption("PropGrid2 demo
5d9e01c545248.jpg
2replies
16views
recent by ravenspoint  ·  Oct 20 at 9:55 pm
Hi, when using inputbox show functions i'm getting : error LNK2019: unresolved external symbol "private: void __thiscall nana::inputbox::_m_fetch_args

i use VS Code, build with "cppStandard": "c++17"
cl.exe PCOMMautom.cpp /Fe: PCOMMautom.exe /EHsc /Zi /D W32 /MT /I..., /LIBPATH:....

please, help me to fix

Thank you much

2replies
12views
recent by pawiq  ·  Oct 13 at 7:09 pm
Holle posted Sep 18 '18 at 5:48 pm
Hi @ all,
I need help :-(

How can I get the data from a listbox?

Here is a example, what I am searching for:

#include <string.h>
#include <vector>
#include <windows.h>
#include <nana>
#include <nana>
#include <nana>
#include <nana>
#include <nana>

// namespaces
using namespace std;
using namespace nana;

// ------------------
5ba12c4eb6359.jpg
38replies
212views
recent by Error Flynn  ·  Oct 6 at 7:56 pm
I can do this in WIN32 like this, but how can I do this in a common way?

HWND hwd = (HWND)fm.native_handle();
SetWindowLong(hwd, GWL_EXSTYLE, GetWindowLong(hwd, GWL_EXSTYLE)|WS_EX_LAYERED );
SetLayeredWindowAttributes(hwd,0,200,2);

0replies
6views
I have tried to fit an image to a button and right now the image is distorted. How to auto fit an image for the nana::button background so that it fills up the button without distorting the image.

The same question goes for auto fitting an icon to a button. In both cased I would like to maintain the aspect ration and fit them in the center of a button.

0replies
7views
ABD posted Sep 28 at 3:20 pm
I tried to use \n to create two lines caption for a button but no success.
So, my question is how to have a two or three or more lines on button caption?

Can Jinhao add a method for the nana::button to accept multiline, like this:

button btn_run(fm, nana::rectangle(50, 320, 90, 45));
btn_run.multi_lines(true);
btn_run.caption("Quit \n this run");
Also, I need to know how to orient text
2replies
37views
recent by ABD  ·  Sep 29 at 3:06 pm
ravenspoint posted Sep 24 at 5:13 pm
What is a nested_form?

I do not understand the documentation

http://nanapro.org/en-us/documentation/page.php?u=/widgets/nested_form

The only code I could find does nothing at all

//class nested_form
nested_form::nested_form(const form& fm, const rectangle& r, const appearance& apr)
: form_base(fm.handle(), true, r, apr)
{
}

6replies
39views
recent by Error Flynn  ·  Sep 28 at 2:15 am
I found an example of using OpenGL with Nana, but it renders on the whole main form. Is it possible to render on a widget instead?

On my application I need two separate OpenGL widgets, apart from a toolbar and other stuff.

I just discovered Nana yesterday, I would very much like to port my FLTK application to it.

0replies
7views
ravenspoint posted Sep 11 at 6:10 pm
In general, I need to build v1.7.2 with -std=c++17, otherwise i have problems with std::filesystem.

( Actually v1.7.2 is still broken, so I am using v1.7.2hotfix )

However, this gives me problems using folderbox.

Code:

#include <nana/gui/filebox.hpp>
#include <iostream>

int main()
{
nana::folderbox picker;

auto paths = picker.show();
if(paths.empty())
21replies
110views
recent by qPCR4vir  ·  Sep 25 at 9:34 pm
Load more
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft