Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 mac 应用程序,我想显示来自特定 nspoint 的工作表,我有多个具有层次结构的视图,所以,我想在(上层视图,即太阳视图的子视图)视图上选择 nspoint,在 nswindow 中获取它并从中获取工作表目标点 c. 如何做到这一点?
我得到了答案:就在上面的子视图或窗口中的任何子视图中 - > NSPoint point = [self.window.contentView convertPoint:[NSApp currentEvent].locationInWindow fromView:nil]; 在视图上获得鼠标点击点。
使用此点的值从该子视图发布通知,在其父窗口中侦听通知,获取相同的点值。保存。
& in window - 用这个点来展示工作表,使用 - willPositionSheet:这个方法改变展示工作表的框架。