LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 11:44 AM   #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, 12: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



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:57 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration