2013/7/23 Arshdeep Singh <moduli16@...400...>:
ColorWheelSelector *wsel = dynamic_cast<ColorWheelSelector*>(SP_IS_COLOR_WHEEL_SELECTOR(nb->getCurrentSelector()));
SP_IS_COLOR_WHEEL_SELECTOR() returns a boolean which is true when the object is of the type SPColorWheelSelector. You need to remove this call. The return type of getCurrentSelector() is ColorSelector*, and you can dynamic_cast this to ColorWheelSelector. If you get NULL, it means the type is different.
ColorWheelSelector *wsel = dynamic_cast<ColorWheelSelector*>(nb->getCurrentSelector()); if (wsel) { // the current selector is indeed a color wheel } else { // the current selector is not a color wheel }
Note that SPColorWheelSelector is a GObject and different from ColorWheelSelector. This obfuscation was introduced by Abhishek Sharma during GSoC 2010 and is still not fixed.
Regards, Krzysztof