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 Dec 21, 2014 10:17 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Image overlaping - how does it works?
PostPosted: Mon Jan 16, 2012 3:43 pm 
Offline
Familiar Face

Joined: Mon Oct 17, 2011 10:18 am
Posts: 26
Dear All,

I will be more than grateful if you could find time for answering me.
I have a complex structure of a GtkWidget that shows a real time video.

Hierarchy:
Container (Gtk Widget) ---points to---> GtkTable (4x4) ---each of cells points to---> EventBox (GtkWidget)
---points to--->GtkWidget ---points to---> GdkPixbuf ---points to---> IplImage (for each frame of the video).

Question:
If I will perform the next operations:
1. Resize one of the images to the dimensions of all the area of the 4x4 grid.
2. Use "gtk_widget_hide_all" for each one of the 3 other images (EventBox).
3. Use "gtk_widget_show_all" for the upper level (GtkTable).

What will happen? To be more precise:
1. Is it possible to see an image on all the area of the table, even though it is attached only to one of it´s cells?
2. Will it be cropped because the other 3 are hidden or not?

For your convenience, you can see the next related posts regarding this issue:
Quote:
http://www.gtkforums.com/viewtopic.php?f=3&t=55667

Quote:
http://www.gtkforums.com/viewtopic.php?f=3&t=55681


Thanks in advance,
Felix.


Top
 Profile  
 
 Post subject: Re: Image overlaping - how does it works?
PostPosted: Thu Jan 19, 2012 10:50 am 
Offline
Never Seen the Sunlight

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

As long as you create your GtkTable to be non-homogeneus (pass FALSE as third parameter togtk_table_new()), cells will automatically resize itself. In your case, cell that has enlarged image will fill the space of entire table while other three cells with hidden widgets will occupy no space at all.

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: Image overlaping - how does it works?
PostPosted: Thu Jan 19, 2012 12:09 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Hang on won't show_all undo the effects of the hide_all?
As to whether it will actually expand... gtk's layout works on requisition of size from the hierarchy above resulting in allocation of size to widgets below. You'll want to make sure that the widget hierarchy within the table will expand and that the image isn't set to be of a fixed size but can also expand. Apart from that you should have no problems; the widgets that are hidden are in memory but don't affect the layout, e.g. if you had a 500x500 table with only one button in one cell t would look identical to the case of assigning the button to span all 500x500 cells.


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: jcfuller 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