Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

GavinT

macrumors member
Original poster
Hi.

I don't want to know exactly how it's done... I'm just after a bit of guidance on which bit of material I should look at, or sample code to crib from.

Anyway, the 'problem'.
I've not written the application yet, and I'm just thinking up ways of using said up. This will be my first Cocoa app (I work in the software industry, Java mainly).

Basically, I'll have a background image (a house plot, or a map), which will be user definable. This will be displayed in a view inside a window. The user will then be able to create a 'plot' which will have a number of attributes associated with it. Part of this will be it's geographical layout. So, what I intend to do is draw a semi-transparent rectangle (or 4 cornered polygon) on top of the image.
In my model, I'd have an object storing the x-y coordinates of each vertex. I'd then draw (using NSPath I understand) the appropriate shape on top of the image. That I can pretty much work out how to do.

What I'm stuck on find info about, is how to then allow the user to drag that shape around, and drag the vertices around to change the shape.
The corresponding model object will then need to be updated (guess I can use Cocoa Bindings for that... in much the same way as you can with textboxes etc).

Cheers,
GT
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Read through Apple's documentation first. Then check out some other articles link, link - there's a lot of info out there. Your situation is more complex than normal, so start off understanding the simple concepts first and work your way up.
 

GavinT

macrumors member
Original poster
Thanks for those specific links. I forgot to look in the Cocoa Dev Central archive... was just looking at the current Tutorials. DOH!!! :eek:

The other link looks good. That's been archived away.



Anyway, as you say, first task is to get the main functionality of the program working. Get the Data Model sorted.
The funky graphics and drag and drop comes in the second version... I was just thinking ahead as usual.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.