JComponent-like functionality in Cocoa/Obj-C
JComponent-like functionality in Cocoa/Obj-C
- Subject: JComponent-like functionality in Cocoa/Obj-C
- From: James Farwell <email@hidden>
- Date: Tue, 20 Aug 2002 15:45:06 +0900
Greetings all,
Sorry if this has already been covered but I didn't really have any luck
searching for it in the archives.
I want to write a custom view that is somewhat similar to those in
Sketch or OmniGraffle in that the user can manipulate objects in the
view by clicking them, dragging them around, etc. I have looked at the
Sketch example code which is very informative, but I was a little miffed
as to the way the actual event handling was done. In Sketch it seems
that the View catches all the mouse events, and then iterates through
the entire list of "graphics" until it finds one that intersects with
the click. This isn't terribly hard to understand, but it seems a
little tedious, almost like something that one would expect "for free"
with Cocoa. I was hoping to find some sort of interface sort of like
JComponent in Java/Swing whereby I could add an objects to the view and
things such as mouse events would automatically get passed on to the
object itself rather than me having to write my own little event pump in
the View. I was thinking that it might be possible to do something like
this using NSCell, but I'm still sort of new to Cocoa and a little vague
on some of these concepts. Does anybody have any suggestions, or is the
way Sketch does it basically the easiest way?
Thanks!
- James
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.