「Xamarin.Macでウインドウ座標をビュー座標に変換する」の版間の差分
編集の要約なし |
imported>Administrator 細 Administrator がページ「Xamarin.Mac/ウインドウ座標をビュー座標に変換する」を「Xamarin.Macでウインドウ座標をビュー座標に変換する」に移動しました |
||
| (他の1人の利用者による、間の1版が非表示) | |||
| 6行目: | 6行目: | ||
<source lang="csharp"> | <source lang="csharp"> | ||
public | public class CustomView : NSView | ||
{ | { | ||
var wLocation = theEvent.LocationInWindow; | public override void MouseDown(NSEvent theEvent) | ||
{ | |||
// これウインドウ座標 | |||
var wLocation = theEvent.LocationInWindow; | |||
// ビュー座標に変換 | |||
// 似たような名前のメソッドがいっぱいあるので注意。 | |||
var vLocation = this.ConvertPointFromView(wLocation, aView:null); | |||
} | |||
} | } | ||
</source> | </source> | ||