Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / October 2007



Tip: Looking for answers? Try searching our database.

NSBorderlessWindowMask and toolbars

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexander Clauss - 11 Oct 2007 13:56 GMT
I need to open a window in fullscreen mode (no menu bar, window
shouldn't have a title bar and covers the whole screen) for a kiosk
environment. But the window should also have a toolbar (a standard
NSToolbar). Unfortunately a window without title bar that is opened with
the option NSBorderlessWindowMask doesn's accept a toolbar.

Using a window with title bar and moving the window title bar out of the
screen so that the title bar isn't visible anymore doesn't work either,
because the system restricts to title bar to be always completely inside
the visible area of the screen.

Is there any way to have a window on screen without a (visible) title
bar which has a standard toolbar attached? Maybe by overwriting certain
methods which prevent that a window with the option
NSBorderlessWindowMask won't accept a toolbar, or by a trick to move the
title bar out of the visible screen area? Or is there an easy way to
attach a NSToolbar like a "normal" NSView into the window content area?

Signature

Alexander

Michael Ash - 11 Oct 2007 15:47 GMT
> Is there any way to have a window on screen without a (visible) title
> bar which has a standard toolbar attached? Maybe by overwriting certain
> methods which prevent that a window with the option
> NSBorderlessWindowMask won't accept a toolbar, or by a trick to move the
> title bar out of the visible screen area? Or is there an easy way to
> attach a NSToolbar like a "normal" NSView into the window content area?

Toolbars mainly give you customizability. The user can show or hide it,
can make the icons big or small or none, can rearrange the items or choose
which ones are visible. It sounds to me like none of this will apply to
you. In that case, is there really any difference between a true NSToolbar
and a region of the window which happens to contain a bunch of borderless
NSButtons with images set?

Signature

Michael Ash
Rogue Amoeba Software

Alexander Clauss - 11 Oct 2007 17:28 GMT
> Toolbars mainly give you customizability. The user can show or hide it,
> can make the icons big or small or none, can rearrange the items or
> choose which ones are visible. It sounds to me like none of this will
> apply to you.

Not really. The application has a "standard" mode where all the windows
are ordinary windows, movable, resizeable, customizable et. But there's
also a Kiosk mode where everything should look and work normally,
without all the customizing stuff.

> In that case, is there really any difference between a
> true NSToolbar and a region of the window which happens to contain a
> bunch of borderless NSButtons with images set?

Customizing is not all a toolbar is good for. There's also the look and
feel, which is important. Reprogramming the toolbar would cause problems
whenever Apple redesignes their GUI.

Also a NSToolbar already has all the item validation code I need,
places and resizes the icons in the toolbar, provides all the behavior
when there's not enough room left (the overflow menu) etc.

Not being able to use the NSToolbar object for a toolbar would require
to reprogramm almost the whole toolbar object again.

Signature

Alexander

Michael Ash - 11 Oct 2007 20:49 GMT
> Not being able to use the NSToolbar object for a toolbar would require
> to reprogramm almost the whole toolbar object again.

Well, so much for that idea.

Back to your idea of using a normal window but positioned so that the
title bar is offscreen. You say that doesn't work because the title bar is
forced onto the screen. Have you tried subclassing NSWindow and overriding
constrainFrameRect:toScreen: to prevent the repositioning?

Signature

Michael Ash
Rogue Amoeba Software

Alexander Clauss - 11 Oct 2007 21:31 GMT
> Have you tried subclassing NSWindow and overriding
> constrainFrameRect:toScreen: to prevent the repositioning?

This is a good idea, and it works well. Thanks.

Signature

Alexander

Michael Ash - 12 Oct 2007 01:30 GMT
>> Have you tried subclassing NSWindow and overriding
>> constrainFrameRect:toScreen: to prevent the repositioning?
>
> This is a good idea, and it works well. Thanks.

Glad to hear it. One out of two isn't so bad. :)

Signature

Michael Ash
Rogue Amoeba Software

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.