Home » Community » Newbie corner » login and main window
login and main window [message #55343] |
Sun, 01 November 2020 17:11 |
BetoValle
Messages: 202 Registered: September 2020 Location: Brasil Valinhos SP
|
Experienced Member |
|
|
There are 2 situations with different startup. What is the reason for the second to generate exception error?
(1) ok
String saida="";
struct Snh : public WithsnhLayout<TopWindow> {
typedef Snh CLASSNAME;
Snh(){
CtrlLayout(*this, "Acesso inicial");
ok.SetImage(ClassImg::btEdita);
sai.SetImage(ClassImg::btSai);
ok <<= THISBACK( fx );
sai << [=] {Exit(); };
}
void fx(){
saida="okxxx";
Close();
}
};
struct MainSig : public WithmenuLayout<TopWindow> {
MainSig(){
Snh se;
se.Run();
if( saida=="okxxx"){
CtrlLayout(*this, "Tela Principal");
menu.Set([=](Bar& bar) {
bar.Sub("File", [=](Bar& bar) {
bar.Separator();
});
bar.Sub("File", [=](Bar& bar) {
bar.Add("Item 1", [&] {
Exit(); });
});
});
}else{
Exit();
}
}
};
GUI_APP_MAIN
{
MainSig sg;
sg.Run();
}
(2) error
String saida="";
struct Snh : public WithsnhLayout<TopWindow> {
typedef Snh CLASSNAME;
Snh(){
CtrlLayout(*this, "Acesso inicial");
ok.SetImage(ClassImg::btEdita);
sai.SetImage(ClassImg::btSai);
ok <<= THISBACK( fx );
sai << [=] {Exit(); };
}
void fx(){
saida="okxxx";
Close();
}
};
struct MainSig : public WithmenuLayout<TopWindow> {
MainSig(){
CtrlLayout(*this, "Tela Principal");
menu.Set([=](Bar& bar) {
bar.Sub("File", [=](Bar& bar) {
bar.Separator();
});
bar.Sub("File", [=](Bar& bar) {
bar.Add("Item 1", [&] {
Exit(); });
});
});
}
};
GUI_APP_MAIN
{
Snh se;
se.Run();
if( saida=="okxxx"){
MainSig sg;
sg.Run();
}
}
|
|
|
Goto Forum:
Current Time: Fri Mar 29 01:10:44 CET 2024
Total time taken to generate the page: 0.01696 seconds
|