Merge pull request #42 from glennw/view-rect
Add accessors for bounds and frame to NSView.
This commit is contained in:
+11
-1
@@ -506,7 +506,7 @@ impl NSWindow for id {
|
||||
// Sizing Windows
|
||||
|
||||
unsafe fn frame(self) -> NSRect {
|
||||
msg_send()(self, selector("frame"))
|
||||
msg_send_stret()(self, selector("frame"))
|
||||
}
|
||||
|
||||
unsafe fn setFrameOrigin_(self, point: NSPoint) {
|
||||
@@ -792,6 +792,8 @@ pub trait NSView {
|
||||
|
||||
unsafe fn init(self) -> id;
|
||||
unsafe fn initWithFrame_(self, frameRect: NSRect) -> id;
|
||||
unsafe fn bounds(self) -> NSRect;
|
||||
unsafe fn frame(self) -> NSRect;
|
||||
unsafe fn display_(self);
|
||||
unsafe fn setWantsBestResolutionOpenGLSurface_(self, flag: bool);
|
||||
unsafe fn convertPoint_fromView_(self, point: NSPoint, view: id) -> NSPoint;
|
||||
@@ -806,6 +808,14 @@ impl NSView for id {
|
||||
msg_send()(self, selector("initWithFrame:"), frameRect)
|
||||
}
|
||||
|
||||
unsafe fn bounds(self) -> NSRect {
|
||||
msg_send_stret()(self, selector("bounds"))
|
||||
}
|
||||
|
||||
unsafe fn frame(self) -> NSRect {
|
||||
msg_send_stret()(self, selector("frame"))
|
||||
}
|
||||
|
||||
unsafe fn display_(self) {
|
||||
msg_send()(self, selector("display"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user