Professional Web Applications Themes

one NSDoent, multiple windows; no focus change - Mac Programming

I've poked around a bit on getting multiple windows working under the NSDoent 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 NSDoent subclass, I load and p 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 ...

  1. #1

    Default one NSDoent, multiple windows; no focus change

    I've poked around a bit on getting multiple windows working under the
    NSDoent 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 NSDoent subclass, I load and p 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
    NSDoent subclass, whose main window is not the "loading" window.
    Here's a snippet called from the NSDoent subclass:

    {
    [[self window] orderOut:self];
    [loadingWindow orderFront: self];

    [self repEverything];

    [loadingWindow orderOut:self];
    [[self window] orderFront: self];
    }

    during 'repEverything', 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 NSDoent subclass, which owns the main
    window, the focus won't change to my desired "currently loading"
    subwindow?

    thanks
    m
    matt Guest

  2. #2

    Default Re: one NSDoent, multiple windows; no focus change

    In <fa39fc69.0309112345.4cdc99f9posting.google.com > matt wrote:
    > I've poked around a bit on getting multiple windows working under the
    > NSDoent 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 NSDoent subclass, I load and p 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
    > NSDoent subclass, whose main window is not the "loading" window.
    > Here's a snippet called from the NSDoent subclass:
    >
    > {
    > [[self window] orderOut:self];
    > [loadingWindow orderFront: self];
    >
    > [self repEverything];
    >
    > [loadingWindow orderOut:self];
    > [[self window] orderFront: self];
    >}
    >
    > during 'repEverything', 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 NSDoent subclass, which owns the main
    > window, the focus won't change to my desired "currently loading"
    > subwindow?
    Instead of formulating a big complicated theory about what's happening
    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]matttidbits.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

Similar Threads

  1. Change focus in a Spry Tabbed panel
    By soatman in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 5
    Last Post: August 4th, 03:15 PM
  2. Change the focus of a movie clip (s)
    By roodboy in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 18th, 03:33 PM
  3. Popup; show, take focus, wait for button action, give focus, hide
    By John van Terheijden in forum Macromedia Flash
    Replies: 0
    Last Post: February 2nd, 12:08 PM
  4. How can I access NSDoent?
    By Toan in forum Mac Programming
    Replies: 32
    Last Post: September 20th, 02:00 AM
  5. Getting NSDoent to load a file into current window
    By Eric Lada in forum Mac Programming
    Replies: 1
    Last Post: September 9th, 04:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139