Ask a Question related to Mac Programming, Design and Development.
-
matt #1
one NSDocument, multiple windows; no focus change
I've poked around a bit on getting multiple windows working under the
NSDocument architecture, and have chosen the multiple
NSWindowControllers route.
unfortunately, that didn't solve my initial problem, which is that i
can't seem to get the window focus to change. I have a theory as to
why, but am not certain. here's my setup:
In my NSDocument subclass, I load and parse a rather large file.
While this is happening, I would like another window to pop up in
front. This secondary window would show a progress bar with an
NSTextView spitting out information as it's parsing. I've managed to
get text spitting out fine, but my problem is that this subwindow
doesn't seem to have 'focus' -- i.e., the little red,yellow, and green
buttons in the upper left aren't on.
One theory is that the actual code that does the parsing is inside the
NSDocument subclass, whose main window is not the "loading" window.
Here's a snippet called from the NSDocument subclass:
{
[[self window] orderOut:self];
[loadingWindow orderFront: self];
[self reparseEverything];
[loadingWindow orderOut:self];
[[self window] orderFront: self];
}
during 'reparseEverything', i call a method on loadingWindow which
spits out text and does a [textView display] to update itself (being
the subwindow).
am i right in thinking that because the actual time-consuming process
happens in code run by my NSDocument subclass, which owns the main
window, the focus won't change to my desired "currently loading"
subwindow?
thanks
m
matt Guest
-
Change focus in a Spry Tabbed panel
I have a tabbed panel with three tabs. email form client form - default tab information Is there a way to change the default tab to the tab... -
Change the focus of a movie clip (s)
I have 14 seperate movie clips that animate big to small and back in space to give the illustion of depth, but they over lap depending on where each... -
Popup; show, take focus, wait for button action, give focus, hide
Hi. I've got a popup MC for displaying a message or asking a yes/no question that has to do the following on an event: - show and take focus... -
How can I access NSDocument?
I have a window that is up all the time from the main nib when the application is launched. This window will process the data and depending which... -
Getting NSDocument to load a file into current window
Hi!, I am new to Cocoa, and was hopeing someone could help me with a little problem I was having. I am writing a simple hex editor, and would like... -
matt neuburg #2
Re: one NSDocument, multiple windows; no focus change
In <fa39fc69.0309112345.4cdc99f9@posting.google.com > matt wrote:
Instead of formulating a big complicated theory about what's happening> I've poked around a bit on getting multiple windows working under the
> NSDocument architecture, and have chosen the multiple
> NSWindowControllers route.
>
> unfortunately, that didn't solve my initial problem, which is that i
> can't seem to get the window focus to change. I have a theory as to
> why, but am not certain. here's my setup:
>
> In my NSDocument subclass, I load and parse a rather large file.
> While this is happening, I would like another window to pop up in
> front. This secondary window would show a progress bar with an
> NSTextView spitting out information as it's parsing. I've managed to
> get text spitting out fine, but my problem is that this subwindow
> doesn't seem to have 'focus' -- i.e., the little red,yellow, and green
> buttons in the upper left aren't on.
>
> One theory is that the actual code that does the parsing is inside the
> NSDocument subclass, whose main window is not the "loading" window.
> Here's a snippet called from the NSDocument subclass:
>
> {
> [[self window] orderOut:self];
> [loadingWindow orderFront: self];
>
> [self reparseEverything];
>
> [loadingWindow orderOut:self];
> [[self window] orderFront: self];
>}
>
> during 'reparseEverything', i call a method on loadingWindow which
> spits out text and does a [textView display] to update itself (being
> the subwindow).
>
> am i right in thinking that because the actual time-consuming process
> happens in code run by my NSDocument subclass, which owns the main
> window, the focus won't change to my desired "currently loading"
> subwindow?
behind the scenes, what about considering the docs on orderFront? The
docs specificially say that this method doesn't make its window key or
main, so you can hardly be surprised if your window doesn't become key
or main. m.
--
matt neuburg, phd = [email]matt@tidbits.com[/email], [url]http://www.tidbits.com/matt[/url]
REALbasic: The Definitive Guide! 2nd edition!
[url]http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt[/url]
Subscribe to TidBITS. It's free and smart.
matt neuburg Guest



Reply With Quote

