LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   extending gtk+-2.0 widgets with c++ (http://www.linuxquestions.org/questions/programming-9/extending-gtk-2-0-widgets-with-c-541049/)

markelo 03-27-2007 11:44 AM

extending gtk+-2.0 widgets with c++
 
Okay. I am trying to create somekind of framework ( just for educating at the moment ).

I want to crete my on button like

Code:

class mybutton : public GtkButton
Problem is that I can't do following thing

Code:

GtkWidget* button;
button=new mybutton();

but with normal gtk button this works.

I could get around this problem without extending button but I don't like that idea. gtktogglebutton is extended from gtkbutton but as much as I get from header file I don't know how extending should be done with c++.

markelo 03-27-2007 12:39 PM

I wrote some nonsence to first post. Following works ( from example you are familiar ).

Code:

GtkWidget *button;
button = gtk_button_new_with_label("HelloWorld");

So that means that I have to create many functions to my extended button class. Not worth the trouble I gues.

Unless somebody know an easy way to extend button widgets...


All times are GMT -5. The time now is 03:16 AM.