Home » Community » Newbie corner » login and main window
Re: login and main window [message #55350 is a reply to message #55349] |
Sun, 01 November 2020 22:46 |
|
Klugier
Messages: 1076 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
In context of login screen I would definitely go to option number 2 (Anyway why do not call this class elegant LoginWindow?):
GUI_APP_MAIN
{
LoginWindow login_window;
if (login_window.Run() != IDOK)
{
// The user click "Cancel" or "System close" button. So, we should finish app execution here.
// I strongly encourage to use notation from 20 GUI Tutorial with Acceptor and Rejector.
return;
}
// We should obtain information about the user somehow...
// Store credentials when user press "Enter" or click on "OK" button in login screen...
Credentials credentials = login_window.GetCrdentials();
MainWindow(credentials).Run(); // <- Run main with authenticated user
}
// In any case there is no need for global variables, which in most cases are not optimal and cause bugs.
Is it fine or you need more info in context of Window infrastructure? Optimally it is the good practice to name variables, classes etc. using English - it will be much easier to us to understand your code and you could easily share it outside your country.
Klugier
U++ - one framework to rule them all.
[Updated on: Sun, 01 November 2020 22:51] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Apr 28 03:09:40 CEST 2024
Total time taken to generate the page: 0.05770 seconds
|