I've a problem to recognize the situation, gtk_widget_show_all has done the work.I try to push some information’s in addition, after all windows are opened.I think the best way is to get an event back and use the g_signal_connect function from GTK, but haven’t found any event if gtk_widget_show_all has done the work.I’m using GTK+2.x from Ubuntu 12.04.I’ve tried to use the ‘expose-event’, but this will generated to early.

What information could you possibly be after after all the widgets have been displayed but before the user has had a chance to supply any input?All I can think of is the dimensions of all your widgets that the display manager has determined and these can be easily accessed through the gtk/gdk API.

It's very hard to tell what you want from what you have written. I think you have followed a certain mindset for program design in approaching your problem, have gotten stuck and are now asking the question "how do I..." from where you currently are at. Trouble is none of us know where you are, what line of reasoning you have followed to get there and also what it is that you want isn't presented too clearly either. Please step back a bit, give us some background of your bigger picture and what you want in broad terms, before giving as much detail and information about the specific problems you are facing. This will help us diagnose whether the problem is just what you are currently trying to do or if it could be fixed by changing your approach in design.

Events are either from user input or changes to the display state. Another option is to have a g_idle_add or g_timeout_add function. Gtk operates on a queue system so as long as you call gtk_widget_show_all before and at a equal or higher priority than your other gtk functions than the latter functions will be executed after show_all is processed. You can also do your signal connection as g_signal_connect_after.

understand and thanks for your answer.My program generates a full screen video using gstreamer. I want to generate an additional info screen after the vidoe screen is shown. But the problem is, if I generate this screen to early, the program crash (memory protection). If I try to use g_timeout_add, I think it's not the best way (because of slower or faster CPU on different systems). I thought that the best way could be to recognize the end of the gtk_widget_show_all process. A other way could be to recognize the IS_PLAYING status of gstreamer.

I take it the info you are talking about is concerning the video. You should not get a crash based on not having shown all the widgets. Whether they are shown or not they are still in memory as a full fledged GObject. I imagine you would get a crash if you try to retrieve information about a video that hasn't been loaded into memory yet. So yes you would be best to do this primarily through gstreamer. You can still generate your bare info screen first, but fill the fields in when you have this information. Use the bus of your pipeline to set up signals, e.g.:

g_timeout_add works fine and is quite normal for keeping track of a running process, e.g. the time currently into the stream, and doesn't have to be done too regularly (200ms will update fast enough for most timing purposes). CPUs for the last two decades have been able to handle such time-sharing functions with ease. I even have a little credit card sized computer that can handle blu-ray playback.

Who is online

Users browsing this forum: Google [Bot] and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum