Skip to content

Instantly share code, notes, and snippets.

@freeonterminate
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freeonterminate/9403846 to your computer and use it in GitHub Desktop.
Save freeonterminate/9403846 to your computer and use it in GitHub Desktop.
OS X の API が、シームレスに扱える例です。
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