Last active
August 29, 2015 13:57
-
-
Save freeonterminate/9403846 to your computer and use it in GitHub Desktop.
OS X の API が、シームレスに扱える例です。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses | |
Macapi.ObjectiveC, | |
Macapi.CocoaTypes, | |
Macapi.Foundation, | |
Macapi.AppKit, | |
FMX.Platform.Mac | |
procedure SetMinSize(const iForm: TForm; const iMinW, iMin: Integer); | |
var | |
Wnd: NSWindow; // OS X 用のクラスがそのまま使えてる | |
Size: NSSize; // こっちも | |
begin | |
Wnd := WindowHandleToPlatform(iForm.Handle).Wnd; // NSWindow を取り出す | |
Size.width := iMinW; | |
Size.height := iMinH; | |
Wnd.setContentMinSize(Size); // そのまま呼び出せる | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment