Home » U++ Library support » U++ Widgets - General questions or Mixed problems » What Label.WhenAction supposed to do? - nothing [PARTLY SOLVED :)]
Re: What Label.WhenAction supposed to do? [message #1860 is a reply to message #1845] |
Fri, 24 March 2006 00:05   |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
fudadmin wrote on Wed, 22 March 2006 13:47 |
Luigi, as an old C programmer I can tell you that you will lose more time with C programming style... . I used this style in my example just for clarity and to have less lines...
And to make a shift from C to C++ you don't need to much time unless you spend time following tutorials which are written with a purpose to make money...
My guess is that your laziness simply hides fear of unknown...
My advice - do it in a lazy man's way - learn from code samples, try to make programs and do not hesitate asking questions here!
|
Thank you for your advice. I'll try to fill the gap. I know the principle of C++ and I've even written some thing many years ago. But when now I approached again the C++ to use it in GUI development I see it is a mess.
Please let me ask you what is the word THISBACK that appear in the code and in assist menu'. For example in the reference assembly the package 'menu':
#include <CtrlLib/CtrlLib.h>
struct App : public TopWindow {
bool numbers_enabled;
void Exit()
{
Close();
}
void EnableNumbers()
{
numbers_enabled = !numbers_enabled;
}
void ShowNumber(int n)
{
PromptOK(AsString(n));
}
void SubMenu(Bar& bar)
{
for(int i = 0; i < 10; i++)
bar.Add(AsString(i), t_(THISBACK1)(ShowNumber, i));
}
void Menu(Bar& bar)
{
bar.Add("Enable numbers", THISBACK(EnableNumbers))
.Check(numbers_enabled);
bar.Add(numbers_enabled, "Numbers", THISBACK(SubMenu));
bar.Add("Exit", THISBACK(Exit))
.Key(K_CTRL_E);
}
void MainBar(Bar& bar)
{
bar.Add("Menu", THISBACK(Menu));
}
MenuBar menu;
typedef App CLASSNAME;
App()
{
numbers_enabled = false;
AddFrame(menu);
menu.Set(THISBACK(MainBar));
}
};
GUI_APP_MAIN
{
App().Run();
}
has some error somewhere because the compiler report:
C:\upp\reference\Menu\menu.cpp: In member function `void App::SubMenu(Bar&)':
C:\upp\reference\Menu\menu.cpp:24: error: `THISBACK1' undeclared (first use this function)
The THISBACK in assist sometime show the list of callback while sometime show nothing. Can you say two words about its purpose and how to use?
Many thanks in advance,
Luigi
|
|
|
 |
|
What Label.WhenAction supposed to do? - nothing [PARTLY SOLVED :)]
By: fudadmin on Mon, 20 March 2006 08:01
|
 |
|
Re: What Label.WhenAction supposed to do?
By: mirek on Mon, 20 March 2006 09:10
|
 |
|
Re: What Label.WhenAction supposed to do?
By: forlano on Wed, 22 March 2006 17:24
|
 |
|
Re: What Label.WhenAction supposed to do?
By: mirek on Wed, 22 March 2006 17:34
|
 |
|
Re: What Label.WhenAction supposed to do?
By: fudadmin on Wed, 22 March 2006 19:47
|
 |
|
Re: What Label.WhenAction supposed to do?
By: forlano on Fri, 24 March 2006 00:05
|
 |
|
Re: What Label.WhenAction supposed to do?
By: mirek on Fri, 24 March 2006 09:20
|
 |
|
Re: What Label.WhenAction supposed to do?
By: forlano on Fri, 24 March 2006 10:11
|
 |
|
Re: What Label.WhenAction supposed to do?
By: forlano on Fri, 24 March 2006 10:52
|
 |
|
Re: What Label.WhenAction supposed to do?
By: mirek on Fri, 24 March 2006 11:01
|
Goto Forum:
Current Time: Sat Jun 07 19:41:51 CEST 2025
Total time taken to generate the page: 0.04677 seconds
|