>>> I need to make a "video capture" plugin to allow any Real Studio
>>> desktop-type application to drag my control into its window and show live 
>>> video.
>> 
>>> It's going to be a Mac OS X only plugin and I have already the code
>>> that shows the live video in an NSView object.
>> 
>>> How can I integrate the NSView into a Real Studio control ?
>> 
>>> The closest thing I could find to get me started was the
>>> SDK example "Eyes Control" but I'd like to hear your suggestions on
>>> how to go about it.
>> 
>>> Thanks.
>> 
>> 
>>      NSView *xx = REALGetControlHandle(instance);
>> 
>>      myView *bt;
>> 
>>      Rect r;
>> 
>>      NSRect bb;
>> 
>>      REALGetControlBounds(inst, &r);
>> 
>>      int height = r.bottom-r.top, width = r.right-r.left;
>> 
>>      bb = NSMakeRect(0,0,width,height);
>> 
>>      bt = [[myView alloc] initWithFrame:bb];
>> 
>>      [xx addSubview:bt];
> 
>> I placed this code in the constructor method that is listed in the
>> REALGetControlHandle structure
> 
>> The problem now is that REALGetControlHandle() is always returning 0
> 
>> Is it better if I make my plugin a "class" like in the "Complete Class" 
>> sample, 
>> or a "control" like the "Eye Control" sample ? Is there any reason that the 
>> former has an Xcode sample project and the latter doesn't ?
> 
>> Thanks again.
> 
> the code need to be set on the openFunction for working !
> 
> on the constructor method, the realbasic control is not created :)

I worked out that the Eye Control plugin sample crashes in the drawing code
when using Cocoa and it runs okay when compiled for Carbon.

Now I placed the code you suggested in the openFunction
and I do at least get valid height and width for my plugin control.
        
The problem is that regardless of whether I use Carbon or Cocoa
I am always getting nil returned by REALGetControlHandle()
I think this is because only objects based on RealControl have the Handle 
property.
        
For the moment I am resorting to a workaround of also placing an extra Canvas 
object
on my Window and passing the handle of that Canvas object to my control.
        
How can I make my control to inherit the properties of a RealControl object ?



_______________________________________________
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