On 23/Oct/2012, at 9:51 PM, Alfred Van Hoek wrote:
> Call [init] in the constructor callback of the REALcontrol:
> 
>                       ControlData(myControl, instance, myViewData, data);
> 
>       NSRect newFrame;
>       Rect bounds;
>       REALGetControlBounds(instance, &bounds);
>       newFrame.size.width = bounds.right - bounds.left;
>       newFrame.size.height = bounds.bottom - bounds.top;
>       
>       newFrame.origin.x = bounds.left;
>       newFrame.origin.y = bounds.top;
> 
>       myView* ed = [[myView alloc] initWithFrame: newFrame];
> 
>       myViewData->theView = ed;
> 
> Make sure you implement the HandleGetter callback of the REALcontrol:
> 
> unsigned long HandleGetter(REALcontrolInstance instance) 
> {
>                       ControlData(myControl, instance, myViewData, data);
>       return (unsigned long)myViewData->theView;
> }
> 
> This way, you get what you want. The Redraw callback will not be called, 
> because REALcontrol-cocoa will handle almost everything, including giving 
> time to your view's draw implementation. No need to call REALcontrolHandle to 
> add your view to the view hierarchy.

I don't know if it matters, but in the constructor the height and width of the 
control are both zero.

Instead of using the video capture view I am now instantiating a simple NSView 
subclass but drawRect never gets called.

Any suggestion ?



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to