• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Beginner Question About CustomView, -drawRect: and Plotting Data.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Beginner Question About CustomView, -drawRect: and Plotting Data.


  • Subject: Re: Beginner Question About CustomView, -drawRect: and Plotting Data.
  • From: Daniel J Farrell <email@hidden>
  • Date: Tue, 27 Jun 2006 13:10:44 +0100

Hi Atze,

Thanks for that.

From reading the documentation on -display I see it calls -drawRect. I'm not so clear on how to pass in the data (see below)? You suggest that I add an instance variable to the custom view class.

Do you think this will work:

Add a new instance variable to the custom view class:
 NSPointArray data;

Then add an method such as -setData: to fill this with NSPoint values.

Then change the -drawRect: method to always draw the data that is in it's data instance.

How do I get the data into the -setData: method in the first place?

You see, I would like my programme to every now again send some data for plotting to the custom view class once it has finished a particular chunk of computation. I don't require a GUI because I'm just number crunching. The way I work at the moment is to just go into the code change the path to the initial data and recompile (the programme is fairly small and only takes seconds to build). It's the computation on this initial data (as it becomes more refined) that I to set to the setData: method for plotting, every few seconds.

Regards,

Daniel.


On 27 Jun 2006, at 12:33, Alexander Spohr wrote:


Am 27.06.2006 um 12:10 schrieb Daniel J Farrell:

Hi folks,

I have a CustomView that does some NSBezierPath drawing from an array of data point that I pass it: I'm plotting some scientific data.

At the moment the only way I can get a custom view to draw is my placing the data inside the -drawRect: method. So my question is: How can I make a method that will plot my data on the custom view every time I call the method e.g. something like - drawRect:WithXData:YData: ?

you won’t. set the data in some ivars, then call -display or let your CustomView drag the data in -drawRect:

evething else would be working against the appkit.

	atze


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Beginner Question About CustomView, -drawRect: and Plotting Data.
      • From: George Orthwein <email@hidden>
References: 
 >Beginner Question About CustomView, -drawRect: and Plotting Data. (From: Daniel J Farrell <email@hidden>)

  • Prev by Date: [SOLVED] Unicode strings in ppc and intel
  • Next by Date: how to attach icon with combo box item ?
  • Previous by thread: Beginner Question About CustomView, -drawRect: and Plotting Data.
  • Next by thread: Re: Beginner Question About CustomView, -drawRect: and Plotting Data.
  • Index(es):
    • Date
    • Thread