full screen (and I do mean full) in Cocoa?

  • So I'm writing a little image viewing class descended from NSView, and I
    want the ability to toggle it into full screen mode, which means
    covering the doc (if it's not being hidden) and the menu bar at the
    top.  The context for this is viewing images, where it's critical to see
    only the image without any other distracting stuff.  I see how to make a
    big window that has no decoration that covers the screen (except for the
    menu bar and it's still below the dock) and I see how to reparent my
    view to be its content view, but I want the window just a hair bigger
    and/or more "on top".

    Any suggestions?

    -->  Michael B. Johnson, Ph.D. -- <wave...>
    -->  Studio Tools, Pixar Animation Studios
    -->  http://xenia.media.mit.edu/~wave
  • > So I'm writing a little image viewing class descended from NSView,
    and I
    > want the ability to toggle it into full screen mode, which means
    > covering the doc (if it's not being hidden) and the menu bar at the
    > top.  The context for this is viewing images, where it's critical
    to see
    > only the image without any other distracting stuff.  I see how to
    make a
    > big window that has no decoration that covers the screen (except
    for the
    > menu bar and it's still below the dock) and I see how to reparent my
    > view to be its content view, but I want the window just a hair bigger
    > and/or more "on top".
    >
    > Any suggestions?

    -[NSWindow setLevel:]

    <http://devworld.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/Ob
    jC_classic/Classes/NSWindow.html#//apple_ref/occ/instm/NSWindow/setLevel:
    >

    Cheers,

    --fred
  • Frederic Stark wrote:
    >


    silly me.  I knew that, but just wasn't setting it high enough.  I figured the menu bar and Dock
    were "special"...

    I picked NSPopupMenuWindowLevel and that worked fine.

    My only excuse is that I'm working with a variety of UI toolkits these days, and still can't get
    over when things are just too easy to do...

    :-)

    --
    -->  Michael B. Johnson, Ph.D. -- <wave...>
    -->  Studio Tools, Pixar Animation Studios
    -->  http://xenia.media.mit.edu/~wave
  • On Thursday, March 29, 2001, at 08:52  AM, Michael B. Johnson wrote:

    > So I'm writing a little image viewing class descended from NSView, and
    > I want the ability to toggle it into full screen mode, which means
    > covering the doc (if it's not being hidden) and the menu bar at the
    > top.  The context for this is viewing images, where it's critical to
    > see only the image without any other distracting stuff.  I see how to
    > make a big window that has no decoration that covers the screen (except
    > for the menu bar and it's still below the dock) and I see how to
    > reparent my view to be its content view, but I want the window just a
    > hair bigger and/or more "on top".
    >
    > Any suggestions?
    >
    If you want to hide the Menu and Doc,

    If you call the CarbonMenu Manager function HideMenuBar() /* Include
    <Carbon/Carbon.h>

    You will get the desired affect, hidding the main menu and as a side
    effect the doc will also get hidden

    vince
  • on 31/03/01 03:06, Vince DeMarco at <demarco...> wrote:

    >
    > On Thursday, March 29, 2001, at 08:52  AM, Michael B. Johnson wrote:
    >
    >> So I'm writing a little image viewing class descended from NSView, and
    >> I want the ability to toggle it into full screen mode, which means
    >> covering the doc (if it's not being hidden) and the menu bar at the
    >> top.  The context for this is viewing images, where it's critical to
    >> see only the image without any other distracting stuff.  I see how to
    >> make a big window that has no decoration that covers the screen (except
    >> for the menu bar and it's still below the dock) and I see how to
    >> reparent my view to be its content view, but I want the window just a
    >> hair bigger and/or more "on top".
    >>
    >> Any suggestions?
    >>
    > If you want to hide the Menu and Doc,
    >
    > If you call the CarbonMenu Manager function HideMenuBar() /* Include
    > <Carbon/Carbon.h>
    >
    > You will get the desired affect, hidding the main menu and as a side
    > effect the doc will also get hidden

    Just wondering, what happens if the Dock is set to hide, you go full screen
    and then the user move the mouse at the bottom, which usually reveals the
    Dock. Will it stay hidden?

    -Laurent.
    --
    ============================================================
    Laurent Daudelin            <http://home.cox.rr.com/nemesys>
    Logiciels Nemesys Software        mailto:<nemesys...>
  • On lördag, mars 31, 2001, at 10:24 , Laurent Daudelin wrote:
    > Just wondering, what happens if the Dock is set to hide, you go full
    > screen
    > and then the user move the mouse at the bottom, which usually reveals
    > the
    > Dock. Will it stay hidden?

    The Dock doesn't need to be hidden per se. If you place the window
    over / higher then the Dock then the Dock can do whatever it pleases and
    still not show...

    From NSWindow:
    =========
    NSNormalWindowLevel    The default level for NSWindow objects.
    NSFloatingWindowLevel    Useful for floating palettes.
    NSSubmenuWindowLevel    Reserved for submenus.
    NSTornOffMenuWindowLevel    The level for a torn-off menu.
    NSMainMenuWindowLevel    Reserved for the application's main menu.
    NSModalPanelWindowLevel    The level for a modal panel.
    NSPopUpMenuWindowLevel    The level for a popup menu.
    NSScreenSaverWindowLevel    Description forthcoming.
    NSStatusWindowLevel    Description forthcoming
    =========

    I'm not sure at which level the dock is, but I know from experience that
    the ScreenSaver is higher then the dock...

    Regards,

    j o a r
  • On Sat, 31 Mar 2001, joar wrote:

    > The Dock doesn't need to be hidden per se. If you place the window
    > over / higher then the Dock then the Dock can do whatever it pleases and
    > still not show...
    >
    > From NSWindow:
    > =========
    > NSNormalWindowLevel    The default level for NSWindow objects.
    > NSFloatingWindowLevel    Useful for floating palettes.
    > NSSubmenuWindowLevel    Reserved for submenus.
    > NSTornOffMenuWindowLevel    The level for a torn-off menu.
    > NSMainMenuWindowLevel    Reserved for the application's main menu.
    > NSModalPanelWindowLevel    The level for a modal panel.
    > NSPopUpMenuWindowLevel    The level for a popup menu.
    > NSScreenSaverWindowLevel    Description forthcoming.
    > NSStatusWindowLevel    Description forthcoming
    > =========
    >
    > I'm not sure at which level the dock is, but I know from experience that
    > the ScreenSaver is higher then the dock...

    kCGNormalWindowLevel = 0
    kCGFloatingWindowLevel = 3
    kCGTornOffMenuWindowLevel = 3
    kCGTornOffMenuWindowLevel = 3
    kCGMainMenuWindowLevel = 20
    kCGStatusWindowLevel = 21
    kCGDockWindowLevel = 10
    kCGModalPanelWindowLevel = 8
    kCGPopUpMenuWindowLevel = 101
    kCGScreenSaverWindowLevel = 1000

    The ScreenSaver is WAY higher than anything else! -- though I suppose
    if you needed an alert to appear above it, you could use 1001.

    -- Steve Majewski