Hi Stephan,
On 1/7/07, Stephan Huber <[EMAIL PROTECTED]> wrote:
An extra flag would be neat, but what for dynamic switching between
windowed and fullscreen mode? ('f' in osgProducer-based apps)
I think a Traits::allowResize flag would probably appropriate.
W.r.t 'f' key to toggle, I won't be adding one to
osgViewer::Viewer/CompositeViewer/SimpleViewer. The GraphicsWindow
will need to support it though. My thought is people want to do
things like toggle fullscreen then they should add an event handler to
do this, this leaves the viewer largely a blank sheet that can be used
for any app.
> Perhaps this is another option to put in GraphicsContext::Traits as a
> hint to know whether to hide the menu-bar or not. Its implementation
> might be platform specific, but having a single bool won't do any
> harm. It might be approrpriate to add an extra method or two to the
> GraphicsWindow base class to help control this aspect.
Yes please :) On OS X you can control to hide the menubar completely or
temporarly, so when you move the mouse to the upper , the menubar pops
back in.
...
I will try to code a nice method, so the menubar gets hidden when the
window is in its area. This is a bit complicated but doable.
Add it what you need and submit it, if I don't feel its appropriate I
can always get back to you, or refactor it a little.
I like it that the app quits, if all windows are closed.
App doesn't actual quite, just that done is set so the frame loop
exits if it checks for viewer.done() as viewer::run() does. Most
examples will be written so that last thing it does is call
viewer.run() so exiting the frame loop exacts to exiting the app.
But it would
be nice to have the ability to set a special quit-flag, so we can force
the viewer to quit on demand.
There is the built is Viewer::setKeySetsDone(int) that provides a
means for setting a key that you can press to sets done to allow you
to exit the frame loop. The default key to Escape, but you can set it
to any other key, or even 0 to disable it this feature.
Also setting viewer.setDone(true) will also cause the frame loop to
exit too. The current code that checks for the number of windows
which are valid also does sets done to true when none are available.
So I can handle the menu-item Quit which
is standard for all OS X application, and even handle the Shortcut
<Cmd-Q> which is also standard. I can even support AppleEvents, which is
a mechanism to communicate between different apps and there's a special
AppleEvent for quitting an app.
Perhaps we should add a APPLICATION_EXIT event or similar to
osgGA::GUIEventAdapter. The GraphicsWindow could catch the events and
put them into the EventQueue and let the app decide what to do. By
default the Viewer would set done to true in response to one of these
events. Like this setKeySetsDone() this could be made an option to
say whether to set done to true or not.
Whether to exit should really be up to end user application though,
and event handler could catch this event and call exit() if so
required, or do whatever steps need to be taken to start the exit in
motion.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/