How to make welcome window?
I am creating an app in which i want to create one welcome window/view (I don't know exactly coz i am very new to c开发者_如何转开发ocoa development) something like this..
So when my app launches this welcome window display at top of the mainWindow
and when i click any Button
from this welcome window/view then and then i can perform any action on mainWindow
.
Can anyone help me in this..??
Thanks in advance..!!
- Learn how to make a window appear/disappear. Look up
makeKeyAndOrderFront:
andclose:
in the documentation. - In your app delegate's
applicationDidFinishLaunching:
, show the welcome window. - When the button is pressed, close the window.
- There's no step 4!
That said, let me say my personal opinion. I don't like welcome windows, because it distracts from me doing the thing I like to do with your app. Not many apps have them. Those who have them always has a checkbox on it which says "don't show welcome window on launch". So, please implement them.
If You want to disable clicks in Your main window you should enable mouse ignoring:
[mainWindow setIgnoresMouseEvents:YES];
and when user clicks welcomewindow's OK button disable ignore mouse events:
[mainWindow setIgnoresMouseEvents:NO];
**where mainWindow is Your IBoutlet main window!
精彩评论