Re: How to manage different display resolutions
Re: How to manage different display resolutions
- Subject: Re: How to manage different display resolutions
- From: email@hidden
- Date: Thu, 18 Nov 2004 21:36:40 -0200
Citando Ricky Sharp <email@hidden>:
>
> On Thursday, November 18, 2004, at 01:01PM, <email@hidden>
> wrote:
>
> >Hi,
> >
> >I am writing an application and it has some NSWwindow objects which at a
> display
> >resolution of 1280x1024 are displayed just fine. But when I change my
> display
> >resolution to say 1024x768, these windows are displayed in such a way that I
> >can NOT see their bottom edges and only part of their width is displayed
> (the
> >other part is hidden to the left of my display and also to the right and if
> I
> >need to see their left and right borders I need to click on the title of the
> >Windows and drag them to the right or to the left.
> >
> >I am sure there is a way to know beforehand the resolution being used at the
> >moment my application gets loaded and also the size of my display. Having
> said
> >that, my questions are:
> >
> >1 - How can I, programmatically, change the coordinates and size of my
> NSWindow
> >object(built with Interface Builder) at the moment my application is loaded?
>
> Check out NSScreen. Specifically, look at the visibleFrame method which
> returns the maximum sized area your window should occupy. It accounts for
> menu bar and the Dock.
>
> You'll then want to listen for
> NSApplicationDidChangeScreenParametersNotification notifications from the
> default notification center. Basically, if the user changes resolutions (or
> the less frequent case of attaching/removing a device), your app is notified
> and you can do the right thing.
I will to these and as soon as I have something done I will send some feedback.
>
> >2 - On my Window's content view I have an object which is a subclass of an
> >NSView class and its size is based on my Window size. If I,
> programmatically,
> >change my Window's coordinates and size, will its coordinates and size be
> >changed too, in order to reflect the new display resolution?
>
> Yes. That's the whole purpose of the autosizing attributes in IB.
>
> >3 - What about some buttons which are displayed on my Window's content view?
> How
> >can I change their coordinates and sizes programmatically in order to
> reflect
> >the new display resolution?
>
> You need to set up appropriate autosizing rules for all your UI elements.
> Some things (e.g. group boxes) will probably always be fixed size. But
> things like table views or lists can grow/shrink to reveal more/less
> information as the window size changes. You should also look into specifying
> the minimum size your window can be to still show a decent layout.
>
>
> Finally, while you're at it, you may want to ensure that your app can work
> correctly with multiple devices. It may be the case where your users have
> two or more monitors each at their own resolution. You can use the NSScreen
> APIs to discover all the connected devices.
>
Thanks for these tips. I will certainly use them in order to have my app running
well in different monitors with differente resolutions.
> --
> Rick Sharp
> Instant Interactive(tm)
>
>
Marcos
___________________________________________________________________________________
Acesse nosso portal www.click21.com.br
Porque internet grĂ¡tis, nem a Embratel pode fazer mais barato. Mas pode fazer melhor.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden