Home » Community » Newbie corner » Hey,i met a problem
Hey,i met a problem [message #47002] |
Wed, 19 October 2016 07:46  |
foxsir
Messages: 1 Registered: October 2016
|
Junior Member |
|
|
Hey,plz help me. i just copy this code from u++ official tutorial,it gave me some compile errors
17 error: no matching function for call to 'Upp::Bar::Add(const char [5],MyAppWindow::SubMenu(Upp::Bar&)::<lambda()>)'
21 error:'class Upp::Bar'has no member named 'Sub'
29 error:no matching function for call to'Upp::MenuBar::Set(MyAppWindow::MyAppWindow()::<lambda(Upp::Bar&) >)'
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct MyAppWindow : TopWindow {
MenuBar menu;
void Exit() {
if(PromptOKCancel("Exit MyApp?"))
Break();
}
void SubMenu(Bar& bar) {
bar.Add("Exit", [=] { Exit(); });
}
void MainMenu(Bar& bar) {
bar.Sub("Menu", [=](Bar& bar) { SubMenu(bar); });
}
typedef MyAppWindow CLASSNAME;
MyAppWindow() {
Title("My application with menu").Sizeable();
AddFrame(menu);
menu.Set([=](Bar& bar) { MainMenu(bar); });
}
};
GUI_APP_MAIN
{
MyAppWindow app;
app.Run();
}
my email is foxsir2016@163.com
|
|
|
Goto Forum:
Current Time: Sat May 03 20:17:19 CEST 2025
Total time taken to generate the page: 0.03692 seconds
|