开发者

click on image in objective-c

开发者 https://www.devze.com 2023-02-10 06:02 出处:网络
I am working on an application (Cocoa/Objective-c) where I have the blueprint of each floor of a building. I need to be able to clic开发者_C百科k on any room, and print some data about that room. I wo

I am working on an application (Cocoa/Objective-c) where I have the blueprint of each floor of a building. I need to be able to clic开发者_C百科k on any room, and print some data about that room. I would also want to highlight the rooms on mouseover. I have no ideea on how to start doing any of this, so any help is appreciated.

Thanks


NSView which I assume is how your handling your UI is a subclass of NSResponder. Which handles all the user events like mouse movements and clicking.

See Apple's documentation of the class http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSResponder_Class/Reference/Reference.html#//apple_ref/occ/cl/NSResponder

And here is an Apple guide to event handling http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventOverview/Introduction/Introduction.html#//apple_ref/doc/uid/10000060i

0

精彩评论

暂无评论...
验证码 换一张
取 消