GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Aug 01, 2014 1:55 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Movable objects in GUI, feed back for position/distance
PostPosted: Sun Nov 27, 2011 2:47 pm 
Offline

Joined: Sun Nov 27, 2011 2:19 pm
Posts: 2
Hello folks,

I want to create a GTK+ GUI for a factory planning program.
The main area in the program shows the space where machines can be inserted. These machines have sources and sinks which are linked individually as a part of the production chain.

The user has to move these areas as he likes to. He presses a 'check'-button which starts a collision detection of the machine areas. If it's negative, the program moves on and calculates each line length of the individually linked sources and sinks. The lines (distances) between the machines are not allowed to go straight from source to sink. They have to flip around the machine areas (primarily squares) in the shortest possible solution.

I followed the glade tutorials from live.gnome.org/Glade/Tutorials but I first have to know, what I'm looking for, because I don't know if there's a whole widget for this or which widgets I have to combine to reach my goal.
The drawing area will not allow me to move created areas with the information of their defined area for collision detection.

Thanks for your help and advice.

bravestarr


Top
 Profile  
 
 Post subject: Re: Movable objects in GUI, feed back for position/distance
PostPosted: Tue Nov 29, 2011 5:11 pm 
Offline

Joined: Sun Nov 27, 2011 2:19 pm
Posts: 2
19 views and no responses.
I just want to add that I do this for myself and not for work. I'm a student.
Anyone any ideas for what I should look after?


Top
 Profile  
 
 Post subject: Re: Movable objects in GUI, feed back for position/distance
PostPosted: Tue Dec 13, 2011 11:06 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
No there's no one widget for this.
You'll have to create one of your own. The gtk website has tutorials on using gtk and cairo to create customised widgets. They'll help you get started. Apart from that you can browse around others code to get pointers.
Things you'll need to get on top of include:
Using GObject to create a customised widget class (based on GtkDrawingCanvas)
Drawing with cairo.
Designing signal handlers for click drag events.

It's not near where you're after but I've got a program that draws circles at certain positions and can detect when you click on a certain set https://github.com/pchilds/MOFsim/tree/master/src (drawcirc.c and .h have the drawing funtions). It might serve as a starting point to get a jump on the learning curve.


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

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 2 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