Db App with login dialog as a no-parent object?

I'm working on GUI front-end to some database system.

I need a login dialog on startup as a first widget to
communicate with user. After valid password and login the
main frame pops-up and user is able to do something in the app.

My question is: What should I use as a main GUI object (main in the sense that it has no parent and other objects are its children, grandchildren..) in the application (e.g. the 'self.main' object with parent as None - the member of wx.App based class).

···

-----

Shall it be the main program frame and login dialog (wxDialog probably) is only one of its elements - after valid login, some dialog bind method fires self.main.Show()

OR

Maybe I should create the dialog frame as a no-parent object and the main program frame will be the children of such dialog frame?

  -----

Please - think of the problem and let me know any of yours suggestions.

Thanks.

Sebastian

Sebastian Żurek schrieb:

I'm working on GUI front-end to some database system.

I need a login dialog on startup as a first widget to
communicate with user. After valid password and login the
main frame pops-up and user is able to do something in the app.

My question is: What should I use as a main GUI object (main in the sense that it has no parent and other objects are its children, grandchildren..) in the application (e.g. the 'self.main' object with parent as None - the member of wx.App based class).

-----

Shall it be the main program frame and login dialog (wxDialog probably) is only one of its elements - after valid login, some dialog bind method fires self.main.Show()

OR

Maybe I should create the dialog frame as a no-parent object and the main program frame will be the children of such dialog frame?

-----

I would create *and* destroy the dialog (no parent) within the OnInit
function of the wx.App . The mainframe will be created afterwards after
a succesfull call to the login dialog.

regards

  Uwe

Uwe Hoffmann wrote:

Sebastian Żurek schrieb:

I need a login dialog on startup as a first widget to
communicate with user. After valid password and login the
main frame pops-up and user is able to do something in the app.

I would create *and* destroy the dialog (no parent) within the OnInit
function of the wx.App . The mainframe will be created afterwards after
a succesfull call to the login dialog.

regards

    Uwe

That's essentially what I've done in one of my apps; it works fine. (I recommend wrapping the dialog in some error handling so you can give the user a useful message if the logon doesn't succeed, either through a bad password, database name misspelled, server not available, ....)

···

--
Don Dwiggins
Advanced Publishing Technology

Don Dwiggins napisał(a):

Uwe Hoffmann wrote:

Sebastian Żurek schrieb:

I need a login dialog on startup as a first widget to
communicate with user. After valid password and login the
main frame pops-up and user is able to do something in the app.

I would create *and* destroy the dialog (no parent) within the OnInit
function of the wx.App . The mainframe will be created afterwards after
a succesfull call to the login dialog.

regards

    Uwe

That's essentially what I've done in one of my apps; it works fine. (I recommend wrapping the dialog in some error handling so you can give the user a useful message if the logon doesn't succeed, either through a bad password, database name misspelled, server not available, ....)

Thanks a lot Uwe and Don! I've created an orphan shaped frame (the shaped size is a great feature of the wxWindows! Take a gander if you have a second: http://pin.if.uz.zgora.pl/~sebzur/download/login-shot.png) as a login box, and I'm destroying it as soon, as the login is correct. I'm catching exceptions also, so the user is getting full info in case of any faults.

Everything works great!

Best regards,
Sebastian