
On 24-9-2012 13:16, Arshdeep Singh wrote:
Now I face a problem in editing the ' RegisteredCheckButton:<GtkWidget>CheckButton' class '
please be extra careful in typing class names in e-mails! This above does not make much sense actually :-)
I added a function 'void setGray(RegisteredChekcButton* ,bool b) to the class definition, obviously the declaration in the <registered-widget.h> and the definition in <registered-widget.cpp>
void setGray (RegisteredCheckButton* A , bool b) { gtk_toggle_set_active ( (GtkToggleButton*) A , !b); }
The object hierarchy shows that GtkCheckButton derives from GtkToggleButton, so this should work. This showed the error that you cannot convert RegisteredCheckButton* to GtkToggleButton* .
It's because RegisteredCheckButton is not derived from GtkCheckButton. It is derived from Gtk::CheckButton (subtle difference!).
But, the RegisteredCheckButton already has a method to gray-out the box: void RegisteredCheckButton::setActive (bool b) Does that not do want you want?
Regards, Johan