GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Nov 27, 2014 9:52 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to change video streaming format by mouse clicking?
PostPosted: Thu Jan 12, 2012 7:04 pm 
Offline
Familiar Face

Joined: Mon Oct 17, 2011 10:18 am
Posts: 26
Hello 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---> GtkPixbuf ---points to---> IplImage (for each frame of the video).

Goal:
I want to implement the next algorithm:
1. Mouse click on one of the images.
2. Hiding all the structure of the 4X4 grid.
3. Showing the clicked image on the area of the 4x4 grid.
And all the way back as well.

Question:
1. What is the best/simplest way to achieve this goal?
2. Related question: is there a built in way to clone a GtkWidget with all the widgets it "wraps"?
For example all the hierarchy that I suggested above?

Thanks in advance,
Felix.


Top
 Profile  
 
 Post subject: Re: How to change video streaming format by mouse clicking?
PostPosted: Fri Jan 13, 2012 10:02 am 
Offline
Never Seen the Sunlight

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

Felix wrote:
1. What is the best/simplest way to achieve this goal?

The best way of dealing with this situation really depends on how your images are sized. If you're in complete control of your widget's size, then simply enlarging your focused widget and hiding the rest of them should do the trick (GtkTable will do the right thing in this case IIRC). Reversing this is also simple: downsize the enlarged widget and show remaining three.

Felix wrote:
2. Related question: is there a built in way to clone a GtkWidget with all the widgets it "wraps"?
For example all the hierarchy that I suggested above?

There is no such way, so you'll have to create all widgets manually. Using some custom-made widgets will probably make your life a bit easier in the long run.

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: How to change video streaming format by mouse clicking?
PostPosted: Fri Jan 13, 2012 12:17 pm 
Offline
Familiar Face

Joined: Mon Oct 17, 2011 10:18 am
Posts: 26
Hello Tadej,

First of all I wanted to thank you for your answerS, and your time.
I have some more questions regarding your suggestion, and I would be grateful if you could answer.
As I have written above, my hierarchy is:
Quote:
Container (Gtk Widget) ---points to---> GtkTable (4x4) ---each of cells points to---> EventBox (GtkWidget)
---points to--->GtkWidget ---points to---> GtkPixbuf ---points to---> IplImage (for each frame of the video)

I have the full control of my IplImage size as well.

As I understand from your reply, what I should do after receiving a mouse click is just to change the IplImage size.
Am I right?
Will the other "parts" of my code adjust "automatically" to this change? In other words will the change of the IplImage size, change the GtkPixbuf, GtkWidget, GtkTable size?

Thanks in advance,
Felix.


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: No registered users 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