GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is there a widget for drawing n-ary trees?

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
pasture
Familiar Face


Joined: 21 Nov 2005
Posts: 5

PostPosted: Mon Nov 21, 2005 9:35 am    Post subject: Is there a widget for drawing n-ary trees? Reply with quote

Hi all,

I'm looking for a widget that draws n-ary tree structures (please have a look at the example: http://www.pasture.de/tree.jpg). The nodes themselves also contain widgets.

I don't have much experience with GTK. Is there a widget I can use or inherit or do I have to start from scratch with drawing arrows and rectangles?

Thank you very much in advance for any suggestions. And let me know in case I should give more detailed information.
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 387
Location: Fairfax, Virginia

PostPosted: Mon Nov 21, 2005 6:45 pm    Post subject: Reply with quote

I would just recommend a GtkDrawingArea or the Gnome canvas if you are using the Gnome UI libraries.
Back to top
pasture
Familiar Face


Joined: 21 Nov 2005
Posts: 5

PostPosted: Tue Nov 22, 2005 11:51 am    Post subject: Reply with quote

Thanks for your message.

It should be possible to launch the application with MinGW, so I guess I cannot use Gnome UI libraries, or am I wrong?

As for the GTKDrawingArea, I also had that idea. However, I think it will be difficult to realize. Whenever the structure of my tree changes, I have to recalculate the position of all the node widgets. And of course, I have to know the size of all the node widgets in order to do that.

It would be great if there was an easier way, but I don't have much hope. :(
Back to top
pasture
Familiar Face


Joined: 21 Nov 2005
Posts: 5

PostPosted: Wed Nov 30, 2005 12:52 pm    Post subject: Reply with quote

I had another idea. Maybe I can use the Graphviz APIs to calculate the coordinates of each node.

At least, if I find out how to use the APIs. But I guess this is the wrong place to ask about that.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP