Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-27-2007, 11:44 AM   #1
Registered: Mar 2004
Distribution: Red hat 9 -> 64bit fedora
Posts: 190

Rep: Reputation: 30
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

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

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++.
Old 03-27-2007, 12:39 PM   #2
Registered: Mar 2004
Distribution: Red hat 9 -> 64bit fedora
Posts: 190

Original Poster
Rep: Reputation: 30
I wrote some nonsence to first post. Following works ( from example you are familiar ).

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...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GTK+- widgets, want to pack them in nonuniform manner BobS0327 Programming 2 04-26-2006 04:30 PM
Widgets are not displaying while execution+GTK santhosh.linux Programming 1 03-17-2006 04:15 PM
GTK theme: not all widgets are changed kornerr Linux - General 1 01-16-2006 09:05 AM
GTK widgets don't show text phaidros Linux - Software 0 12-16-2003 06:45 AM
GTK problem: no text in widgets phaidros Linux - Newbie 0 12-16-2003 02:16 AM > Forums > Non-*NIX Forums > Programming

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration