"Frame type" for ShowModal Modal Windows

Hi Everyone,

I’ve been unable to get the ShowModal or ShowModalWithin methods to work.
I’m a bit confused with the Window.ShowModal documentation . It says: “You must use a modal window Frame type to force the window into a modal state.”.

Could someone kindly point me in the direction of an example as to what this means in practice (i.e. how to make a Window object modal)?

Much Appreciated,
M.

P.S. My goal is to create a custom Login modal dialog. Is the Window class (with ShowModal/ShowModalWithin) the way to do this? If someone could link me to a practical example of creating a user-login, that’d be greatly appreciated!

In the IDE when you create a new Window one of the properties is “Type” (document, moveable modal etc)
You can see the properties in the inspector

Set that to Movable Modal, Modal or Sheet which are all “modal dialog” types
In conjunction with ShowModal or ShowModalwithIn your dialog will be fully modal

There is a lovely manual included with every Xojo download. It covers basics like using the IDE.
Check it out inside the Documentation folder!

Thanks! I’m embarrassed that I missed that.
I searched “Frame type” in the language reference, without realizing that it was just a Window property all along!
…funny how I can read “Frame type” versus “Frame type Property”, and get confused thinking they are different concepts…
My apologies!

With respect to creating a Login window: Any links to best practices or an example?
I was planning to just use a database lookup table with usernames & passwords to validate the dialog fields, and then store the username in an App Property so that the program can reference/know who’s currently logged in…

Remember that passwords should never be stored plain.
If the log in is more like a “are they allowed to access” for something simple, like a basic DRM, then a simple lookup and storing the username to display back to the user shouldn’t be a problem.

If you’re trying to be secure and make sure only authorized users have access to data, and whether or not they are able to make changes, then I would suggest stepping up the security a bit. Each action should require an authorization token valid only for the single session, and logged.

I have no idea what your use case is, so it’s hard to be more specific. There are also people here who know more about security than I do, I’m more of an app/ui/ux person. (I’m better at making things easy on the eyes, and easy to use.)

Thanks Tim. You’ve expressed my concerns with my approach re: security.

I’m developing a company system where controlling database access and creating traceability records will be important.
Although I was planning to just do a “quick-and-dirty” login implementation initially, so I can move on to the meat of the application, in general I prefer to do things right the first time, rather than have to revisit later.

…which is why I was hoping there was an example/tutorial/documentation someone could reference/link-to that illustrates an effective implementation that I could adopt…

Ah, found a resource from Tim McGrath in this thread .

A lot to learn…

Thanks everyone. This community is very helpful!