Re: Progress bar
Re: Progress bar
- Subject: Re: Progress bar
- From: Shawn Erickson <email@hidden>
- Date: Thu, 10 Nov 2005 16:54:00 -0800
On Nov 10, 2005, at 3:17 PM, Andrea Salomoni wrote:
Hi,
Thank you very much for reply.
I tryied to use your method... but it still doesn't work.
my awakeFromNib methos is the controller of the app that is a
NSObject subclass...
Cannot really understad how to do it...
I will fire off another email about the threaded version I suggested
shortly however I believe you are fighting with another issue. It may
help us if you can explain what is going wrong or at least the first
thing that is going wrong. For example are you even seeing the splash
window. If so are you seeing anything in that window, etc.
Looking at you code snippet again...
You attempt to display status...
[myStatusField setStringValue:@"Setting up database"];
[myStatusField display];
(note display is not needed here, since I believe the window that
contains the view isn't even visible yet)
...then create a window, put some theView in it, load an image, setup
an action...
loadWindow = [[NSWindow alloc] initWithContentRect:[loadWindow
frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered
defer:YES];
[loadWindow setContentView:theView];
[loadWindow setHasShadow:YES];
[theImage setImage:[NSImage imageNamed:@"splash.tif"]];
[theImage setTarget:loadWindow];
[theImage setAction:@selector(orderOut:)];
[loadWindow makeFirstResponder:theImage];
[loadWindow setLevel:NSStatusWindowLevel];
[loadWindow setIgnoresMouseEvents:NO];
[theImage setNeedsDisplay];
(note setNeedsDisplay is not needed here, since I believe the window
that contains the view isn't even visible yet)
[loadWindow makeKeyAndOrderFront:self];
...then do some work...
[upgrade checkDirectory];
...then do some other stuff I don't understand...
[self addToWin:thisWindow];
[myPrintFolder addToWin:myFolderPanel];
[metarPop removeAllItems];
...then attempt to display a different status message...
[myStatusField setObjectValue:[NSString stringWithString:@"Quering
database....."]];
... then do more stuff...
I question why you are creating a window in awakeFromNib then setting
the content view of that window to be "theView", I assume it is
because you want a borderless window right?
It is not clear how "theView" was created... was it created and
populated in IB? If it lives in your nib I assume "theView" is an
outlet that you have connected to a view. Double check it is
connected as you expect in IB.
What is in that view? It looks like some type of non-editable
NSTextField and maybe a NSImageView? The NSTextField is connected to
the outlet called "myStatusField" and the NSImageView is connected to
the outlet called "theImage". Double check both are connected as you
expect in IB.
If you don't want to use the threaded approach then make sure to send
"myStatusField" a displayIfNeeded message every time after you send
it "setStringValue:" to force a redraw of the view. In this
particular case you will have to do that with any view that you want
to be updated.
if you also want to show an spinner version of NSProgressIndicator
then use IB to put one in your view and make sure it is set to be
"Indeterminate" and of type spinner (or do that in code). Also create
an outlet for it so you can send it messages. Then send it the
following before you show your splash window...
[progressIndicator setUsesThreadedAnimation:YES];
[progressIndicator startAnimation:self];
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden