Search code examples
user-interfacexcode4cappuccino

Adding a cappuccino CPProgressIndicator with Xcode 4


building the GUI of my cappuccino project, adding an NSProgressIndicator into the GUI result in an error "cannot decode object of class (NSProgressIndicator)" while compiling from the XCodeCapp-cocoa. I tried to manually specify a "Custom Class" to CPProgressIndicator but it still do not work. I thus guess that nib2cib is still not support progressIndicators but it sounds strange to me, then:

  • Is there something wrong with my version ?

  • Is there a possible way to graphically set the bar (i.e. from the interface builder) and compile this CPProgressIndicator ? (any workaround ?) or do I have to set it myself from code ?


Solution

  • NSProgressIndicator is not supported by nib2cib today. If you create a custom NSView and set its custom class to CPProgressIndicator, as you tried, you should get the right class but it might still not initialise properly. You could try to configure it by hand after your cib has loaded. E.g. by connecting it to an outlet and in awakeFromCib sending it,

    [indicator setStyle:CPProgressIndicatorBarStyle];
    [indicator updateBackgroundColor];
    

    Also, if you haven't already, go ahead and submit a feature request for NSProgressIndicator support at the Cappuccino project.