GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Apr 20, 2014 9:13 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Problem with the extension of a new widget
PostPosted: Wed Jul 04, 2012 9:14 am 
Offline
Familiar Face

Joined: Thu Apr 12, 2012 10:34 am
Posts: 8
Problem with the extension of a new widget

Hi all, I appeal to all those who have already had experience in creating sub-classes of widget, from existing widget.

My intention was to create a more advanced class GtkTreeView, to extend some of its functions, and provide a simple interface (not just graphics) to create programs that operate on the database.

The problem has a cause logic... :S

... because, logically and functionally, my class inherited from GtkTreeView, but graphically, to integrate a toolbar of buttons, should inherit from GtkVBox.

At the time, I corrected the problem, adding the widget to the container generally exploiting gtk_widget_get_parent () .... This course allowed me to continue development of my class, but it certainly has not solved the problem.

The intension is to continue to make so that the class continues to inherit from GtkTreeView, to take advantage of certain features and some signals already present, but avoiding having to access with the GtkVBox that the continene to integrate with the rest of the window.

Honestly, after much effort, I would hate not being able to provide this widget to blame for this "conflict" of inheritance. If any of you can help me, I'd be very grateful! :)


Top
 Profile  
 
 Post subject: Re: Problem with the extension of a new widget
PostPosted: Mon Jul 09, 2012 10:21 am 
Offline
Familiar Face

Joined: Thu Dec 15, 2011 6:23 pm
Posts: 36
Location: Hrvatska
not sure what you are trying to do...
but it looks to me that you grab to much.
why should anyone want TreView and Toolbars and Buttons in one mastodon widget ?
it is quite logical to have one container with separate widget for that funcionality...


Top
 Profile  
 
 Post subject: Re: Problem with the extension of a new widget
PostPosted: Mon Jul 09, 2012 3:23 pm 
Offline
Familiar Face

Joined: Thu Apr 12, 2012 10:34 am
Posts: 8
Better define the scope of this widget:

This widget was created in order to simplify the management of a body of data in a table. The main advantage is a simplified reading of the record in the table with the ability to arrange pages in the table, allowing for easier consultation by the user and less work for the rendering engine. It also provides a common interface simple and intuitive for the major management operations, such as inserting and deleting, or sorting of records in the table.

Having said that my problem is far and can be summarized in the following sentence:
"How can I create a class that at the logic / functional inherits from a class (GtkTreeView), while the graphics layer extends from another class (GtkVBox) ".

For someone might be trivial, but it is the last hurdle that allows me to complete this new widget to make it available to the GTK community development. :)


Top
 Profile  
 
 Post subject: Re: Problem with the extension of a new widget
PostPosted: Mon Jul 09, 2012 8:32 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 709
Location: UK
Hi,

Just to add to your thoughts GtkVBox has been deprecated since GTK+ v3.2 so you should not use it in new code. For GTK+ v3 you should consider using GtkGrid instead.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Problem with the extension of a new widget
PostPosted: Tue Jul 10, 2012 8:11 am 
Offline
Familiar Face

Joined: Thu Apr 12, 2012 10:34 am
Posts: 8
Ok, I will take to make the change, but I do not think that makes much difference since GtkVBox I just wanted to manage as a single widget the table and the toolbar below it.

Not that I still do not understand my request. This is a problem of inheritance / expandability of a widget. Please anyone who is able to give me some advice.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group