GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Jul 29, 2014 4:38 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How to set the widget's position?
PostPosted: Thu Jul 14, 2011 6:56 am 
Offline
Familiar Face

Joined: Sat Jun 07, 2008 2:31 pm
Posts: 34
Location: Hangzhou, ZheJiang, China
In the past, we can set the widget's position by using function: gtk_widget_set_uposition(). But it has been deprecated. By reading reference manual, I found the function gtk_widget_size_allocate() can do that. But I don't know how to do it. Does anyone give a example? Thank you.


Top
 Profile  
 
 Post subject: Re: How to set the widget's position?
PostPosted: Thu Jul 14, 2011 9:26 am 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Hello.

Playing with allocations is really not something you should do (especially if you packed your widgets properly). gtk_widget_set_uposition() was mostly useless (you can only move windows with it), so it has been removed (you can still move windows using gtk_window_move()).

Why do you need such functionality? Does regular packing of widgets isn't feasible in your situation?

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: How to set the widget's position?
PostPosted: Fri Jul 15, 2011 4:23 am 
Offline
Familiar Face

Joined: Sat Jun 07, 2008 2:31 pm
Posts: 34
Location: Hangzhou, ZheJiang, China
I'am writing a program called "express-bill-print". First, I get the express bill image by scanning the express bill. This image is as the background of the program. Then I put the GtkEntries(contact, address, tel, etc) into the interface. So I should be sure the position of these entries.
If I create the whole express bill using gtk+, the workload is too heavy.


Top
 Profile  
 
 Post subject: Re: How to set the widget's position?
PostPosted: Fri Jul 15, 2011 8:38 am 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
What about using GtkFixed here? You can then position child widgets using gtk_fixed_put() and gtk_fixed_move().

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: How to set the widget's position?
PostPosted: Mon Jul 18, 2011 2:16 am 
Offline
Familiar Face

Joined: Sat Jun 07, 2008 2:31 pm
Posts: 34
Location: Hangzhou, ZheJiang, China
tadeboro wrote:
What about using GtkFixed here? You can then position child widgets using gtk_fixed_put() and gtk_fixed_move().

Cheers,
Tadej

Thank you very much!


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