Help with Custom Control
Help with Custom Control
- Subject: Help with Custom Control
- From: Carlos Eduardo Mello <email@hidden>
- Date: Thu, 24 Mar 2011 00:10:47 -0300
Hi,
I built a special control with a custom view and several parts,
including standard controls and some subviews. The thing does special
displaying and animation, and needs to be connected to other parts of
the UI and to the document controller. The set up works very nicely.
Isolating it as a unit helped me debug minor drawing bugs and make its
internal behaviour very consistent. However, I need to use several of
these in the UI, so the whole wiring business involves dozens of
connections in IB. Hence my questions:
1. Is there a way to make a custom NSView send IBActions as if it were
one of the standard controls?
2. Is there a simple way to turn my little device into something I can
add to the library and reuse in several places. The idea would be to
treat it as aunit and be able to just wire an Action to the file's
owner.
3. The way it is working right now is through a triple delegation - I
need to have a mouse up event initiated in a subview of my custom view
trigger an action in the enclosing view which is in turn forwarded to
the controller.
A, B and C are Custom Views
A contains B, B contains C;
B is C's delegate, A is B's delegate,
File's Owner is A's delegate;
Clicking C sends a message to F.O.
It works, but I was wondering if the design is not too complicated? (I
am trying to keep each part from having to "know" about other part's
workings).
I'd appreciate any ideas...
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden