Skip navigation.
 
mlRe: Custom palette questions
FROM : E. Wing
DATE : Wed Nov 17 23:49:44 2004

> The following setup works for my palettes. First of all, you drag the
> header containing your view into the nib file containing your palette.
> Using the class inspector to add your outlets and actions should do
> the same thing, but dragging seems to be simpler. Then, you should
> add your class to the array 'ExportClasses' in your palette.table file.
>



Thanks for the response. I'm actually using the new Palette template
under Xcode 2.0 so things are a little different, but your response at
least told me that it should be possible.

Strangely, the drag header thing wasn't working for me initially.
After giving up for a few days to work on other things, the header
thing finally worked when I tried it one more time. Maybe it was the
reboot that did it.

But now, I have an IBAction I can't remove. I added a test action
which did appear as a Target/Action. But when I deleted the method in
the header, and later deleted it, the action is still available in the
palette. I can't get rid of it. When I redragged the header to the
palette, I was prompted to Merge or Replace. I selected Replace, but
the action still remains. I can't manually delete it from the palette
either because it is greyed out.


>
>
> > My second question is, how I can draw something in my palette so it
> > isn't just a blank white rectangle. Because my view is a subclass of
> > an NSOpenGLView, I have defined my drawRect method. But in Interface
> > Builder, it doesn't seem to render my OpenGL calls. So I get a white
> > rectangle.
>
> Your drawRect: should be called as usual. You might use NSLog() to
> verify this (the log messages will appear in the console.log file.) A
> potential problem is that no outlets or bindings are set on the view
> object in IB. Connected outlets are not recorded in their source objects
> but in special objects which will establish the connection after the
> nib file was loaded in an application.


Things were setup correctly. I placed NSLogs all over my code so the
flow looked correct. I'm expecting OpenGL not to be rendered correctly
when in a palette. This wouldn't surprise me considering other
limitations I've seen with OpenGL rendering on the system (e.g, blank
white rectangle when an OpenGL window is minimized to the dock). I
should clarify though, in live Test Mode, the OpenGL is rendered
correctly. It is just when the OpenGLView is on the palette when you
are building your interface that is a problem.

Anyway, Rainer's solution using a category was a great trick and I now
have a visual representation I can live with.

Thanks again,
Eric

Related mailsAuthorDate
mlCustom palette questions E. Wing Nov 12, 03:52
mlRe: Custom palette questions Hauke Klein Nov 12, 11:53
mlRe: Custom palette questions E. Wing Nov 17, 23:49