Professional Web Applications Themes

Using Menu Bar Space - Mac Programming

Working from Java using JNI, I have hidden the menu bar and dock using HideMenuBar(). I want to position my window at 0, 0 to get a full screen presentation mode. Think PowerPoint; the need is pretty similar. The window gets bounced down to give the menu bar space, even though the menu bar is hidden. I can set the location above the menu bar, perhaps to 0, -40, but when I do this, mouse locations seem to be off by about the hight of the menu bar. (This may be caused by Java, rahter than Mac OS/X--I really don't ...

  1. #1

    Default Using Menu Bar Space

    Working from Java using JNI, I have hidden the menu bar and dock using
    HideMenuBar(). I want to position my window at 0, 0 to get a full
    screen presentation mode. Think PowerPoint; the need is pretty
    similar. The window gets bounced down to give the menu bar space, even
    though the menu bar is hidden.

    I can set the location above the menu bar, perhaps to 0, -40, but when
    I do this, mouse locations seem to be off by about the hight of the
    menu bar. (This may be caused by Java, rahter than Mac OS/X--I really
    don't know.)

    Is there some trick I'm missing that would allow me to place the
    window at the top left of the screen, or even a little above the top
    left of the screen, without messing up mouse coordinates?

    Mike Westerfield
    Mike Guest

  2. #2

    Default Re: Using Menu Bar Space

    In article <google.com>,
    com (Mike Westerfield) wrote:
     

    Why don't you use QuickTime?

    <http://developer.apple.com/doentation/Java/Reference/1.3.1/Java131API
    _QTJ/quicktime/std/movies/FullScreen.html>

    or, using JNI to get at the slightly different C version:

    <http://developer.apple.com/doentation/QuickTime/APIREF/SOURCESI/begin
    fullscreen.htm>

    Reinder
    Reinder Guest

  3. #3

    Default Re: Using Menu Bar Space

    Reinder Verlinde <invalid> wrote in message news:<wxs.nl>... 
    >
    > Why don't you use QuickTime?
    >
    > <http://developer.apple.com/doentation/Java/Reference/1.3.1/Java131API
    > _QTJ/quicktime/std/movies/FullScreen.html>
    >
    > or, using JNI to get at the slightly different C version:
    >
    > <http://developer.apple.com/doentation/QuickTime/APIREF/SOURCESI/begin
    > fullscreen.htm>
    >
    > Reinder[/ref]

    For a long time, I did use QuickTime's FullScreenWindow().

    When QTJava 6.1 came out, I needed something else, since
    FullScreenWindow had been depricated and FullScreen doesn't work well,
    so I transitioned the entire program to use Frame.setUndecorated. On
    Windows, this hides the start menu. On OS/X 10.3, I use a little JNI
    to call SetSystemUIMode(kUIModeAllHidden, 0). I'm trying to do
    essentially the same thing unser 10.3, which does not support this
    call, using HideMenuBar(). This hides both the menu bar and dock--so
    far, so good--but it leaves me with the aforementioned problem when I
    try to move the window to cover the old menu bar area.

    Of course, I _could_ still use the QTJava 6.0 FullScreenWindow() call
    on 10.1, but during the transiotion away from QTJava calls on 10.3, I
    discovered that a number of annoying screen update bugs simply
    vanished when I stopped using QTJava to get a full screen. For that
    reason, I want to avoid using QTJava on 10.1, too. For what it is
    worth, the screen refresh issues did not occur on Windows and Mac
    Classic, only on OS/X running QTJava 6.0.

    Mike Westerfield
    Mike Guest

  4. #4

    Default Re: Using Menu Bar Space

    In article <google.com>,
    com (Mike Westerfield) wrote:
     

    On this web page: "How to Create a Full-Screen Context"
    (for OpenGL)
    <http://developer.apple.com/doentation/GraphicsImaging/Conceptual/OpenGL/chap3/chapter_3_section_3.html>
    Apple recommends calling CGDisplayCapture() to take the display away
    from the window system before doing full screen graphics, and calling
    CGDisplayRelease() to put it back. These are defined in the Mach-O
    version of Carbonlib.

    CGDisplayCapture is Core Graphics, so it applies even if you aren't using
    OpenGL.

    David Phillip Oster
    David Guest

  5. #5

    Default Re: Using Menu Bar Space

    In article <google.com>,
    com (Mike Westerfield) wrote:
     

    What led you to conclude that 10.3 doesn't support SetSystemUIMode? As
    far as I know, that API is supported in 10.3.

    -Eric

    --
    Eric Albert stanford.edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  6. #6

    Default Re: Using Menu Bar Space

    You need to do the following:


    ChangeWindowAttributes(myWindPtr,kWindowNoConstrai nAttribute,0);


    The second parameter means that the OS will not try to move the top
    of the window below the (now missing) menubar.

    Hope this helps.


    nlexcom
    Neil Guest

  7. #7

    Default Re: Using Menu Bar Space

    Eric Albert <stanford.edu> wrote in message news:<stanford.edu>... 
    >
    > What led you to conclude that 10.3 doesn't support SetSystemUIMode? As
    > far as I know, that API is supported in 10.3.
    >
    > -Eric[/ref]

    10.3 does support SetSystemUIMode(kUIModeAllHidden, 0), and I'm using
    it. 10.1, however, does not. That's the rub.

    Mike Westerfield
    Mike Guest

  8. #8

    Default Re: Using Menu Bar Space

    com (Neil Alexander) wrote in message news:<google.com>... 

    Thanks, I'll give that a try.

    I'll need to find some way to convert a Java JFrame to a Mac OS
    WindowRef, but that seems like a question more appropriate for the
    Java areas.

    Mike Westerfield
    Mike Guest

  9. #9

    Default Re: Using Menu Bar Space

    David Phillip Oster <org> wrote in message news:<sf.sbcglobal.net>... 
    >
    > On this web page: "How to Create a Full-Screen Context"
    > (for OpenGL)
    > <http://developer.apple.com/doentation/GraphicsImaging/Conceptual/OpenGL/chap3/chapter_3_section_3.html>
    > Apple recommends calling CGDisplayCapture() to take the display away
    > from the window system before doing full screen graphics, and calling
    > CGDisplayRelease() to put it back. These are defined in the Mach-O
    > version of Carbonlib.
    >
    > CGDisplayCapture is Core Graphics, so it applies even if you aren't using
    > OpenGL.
    >
    > David Phillip Oster[/ref]

    This seems like a good point, but I could not get it to work from
    Java. It seems that the display capture is a little too agressive, and
    prevents Java from using the screen. :)

    Mike Westerfield
    Mike Guest

  10. #10

    Default Re: Using Menu Bar Space

    In article <google.com>,
    com (Mike Westerfield) wrote:
     
    >
    > This seems like a good point, but I could not get it to work from
    > Java. It seems that the display capture is a little too agressive, and
    > prevents Java from using the screen. :)[/ref]

    Once you've captured the display, you are responsible for creating a
    window on top of the O.S's "Shield window" in which you'll draw your
    graphics. Debugging is a problem, since all mouse events and keystrokes
    go to your program, not the debugger, so you might consider dual-machine
    debugging.
    David Guest

  11. #11

    Default Re: Using Menu Bar Space

    In article <google.com>,
    com (Mike Westerfield) wrote:
     
    > >
    > > What led you to conclude that 10.3 doesn't support SetSystemUIMode? As
    > > far as I know, that API is supported in 10.3.[/ref][/ref]
     

    Ah. Do you actually have a significant number of customers running
    10.1? In the surveys I've seen from various software authors, nearly
    all Mac OS X users are running 10.2 or later.

    -Eric

    --
    Eric Albert stanford.edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  12. #12

    Default Re: Using Menu Bar Space

    Eric Albert <stanford.edu> wrote in message news:<stanford.edu>... [/ref]

    >
    > Ah. Do you actually have a significant number of customers running
    > 10.1? In the surveys I've seen from various software authors, nearly
    > all Mac OS X users are running 10.2 or later.
    >
    > -Eric[/ref]

    Significant? Not really. There are some, though, and we would like to
    include them if at all possible. By and large, the program works just
    fine from 10.1, so it would be nice to get this little detail taken
    care of.

    Mike Westerfield
    Mike Guest

Similar Threads

  1. Help wiht converting this actionscript vertical menu to a horizontal menu?
    By Synergy Media webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: January 28th, 04:50 PM
  2. PVII Menu Magic II Multi-Level Menu Tutorial
    By Sam in forum Macromedia Dreamweaver
    Replies: 2
    Last Post: August 6th, 03:09 AM
  3. ANNC: PVII Menu Magic II Multi-Level Menu Tutorial.
    By Japes in forum Macromedia Fireworks
    Replies: 1
    Last Post: August 6th, 12:17 AM

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