Proportional from code

Member
Posts: 131
Joined: 2010.08
Post: #1
How to make a view's size and location proportional to the windows's size from code, like it can be done in the size inspector?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #2
UIView.autoresizingMask is the property you are looking for. There are six constants that you can bitwise OR together that correspond to the 6 spring button things in IB.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #3
Thanks. This is an offtopic question: In the Cocoa Event-Handling Guide in the "Creating an NSTrackingArea Object" section is written this: "An NSTrackingArea object defines a region of a view that is sensitive to the movements of the mouse. When the mouse enters, moves about, and exits that region, the Application Kit sends mouse-tracking, mouse-moved, and cursor-update messages. The region is a rectangle specified in the local coordinate system of its associated view."
Does this mean that the rectangle is specified in the coordinate system that is set with glOrtho? So does NSTrackingArea check the OpenGL coordinate system?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
No. It checks the AppKit coordinate system.
Quote this message in a reply
Post Reply