Skip navigation.
 
ml[Absolutely Baffled] Drag-and-Drop updating a controller techniques, advice sought...
FROM : Steven G. Harms
DATE : Tue Oct 05 22:14:39 2004

Hello,

I am still trying to wrap my head around how to update the controller
of my two nibs during a drag and drop procedure.


Nib1      Nib2

+-----+  +-----+
|    |  |    |
| c4  |  |    |
|c2 c3|  | d1  |
|  c1 |  |    |
+-----+  +-----+

I am going to DRAG an image from (Nib2.d1) and drop it in (Nib1.c[1-4]).

Nib1 is a MyDocument and Nib2 is an auxillary nib that can be popped
up as a browser from Nib1.


Both c[1-4] and d1 are "MyImageView" objects

I have set up the code such that I can do the drag and drop
operation....BUT, this is strictly a manipulation of the VIEW
component.  How can I load this into some sort of controller, and upon
having the data in a controller how can I create a data structure
suitable for archiving?

What I __REALLY__ want is to be able to produce an NSDictionary that
says:


{
  @"c1" => pointer to a MyImageView's Image :name (an NSString),
  @"c2" => pointer to a MyImageView's Image :name (an NSString),
  @"c3" => pointer to a MyImageView's Image :name (an NSString),
  @"c4" => pointer to a MyImageView's Image :name (an NSString)
}

I could then archive this NSDictionary easily.  Upon a load it would
be simple to iterate through the dictionary and know that c3 needed
to be instantiated with the NSImageView based on such-and-such
string name (small storage file).

So how to produce this data structure?  Here were some thoughts:

- Is there an onUpdate that I could implement in c[1-4] so that they send
a notification?

- Is a timer the way to go?  Maybe all of the c[1-4] widgets every so many
seconds send an update into the controller?

Most of the tutorials deal with the superficial visual cool of a
drag-n-drop...but don't really help me figure out how to make sure the
controllers are updated.

Thanks!

Steven

Related mailsAuthorDate
No related mails found.