LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 03-27-2007, 12:44 PM   #1
markelo
Member
 
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

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++.
 
Old 03-27-2007, 01:39 PM   #2
markelo
Member
 
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 ).

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


Reply


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 05:30 PM
Widgets are not displaying while execution+GTK santhosh.linux Programming 1 03-17-2006 05:15 PM
GTK theme: not all widgets are changed kornerr Linux - General 1 01-16-2006 10:05 AM
GTK widgets don't show text phaidros Linux - Software 0 12-16-2003 07:45 AM
GTK problem: no text in widgets phaidros Linux - Newbie 0 12-16-2003 03:16 AM


All times are GMT -5. The time now is 10:45 PM.

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