Home » Community » Newbie corner » login and main window
Re: login and main window [message #55347 is a reply to message #55345] |
Sun, 01 November 2020 19:30 |
BetoValle
Messages: 203 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: Sat May 11 14:36:40 CEST 2024
Total time taken to generate the page: 0.02686 seconds
|