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 Sep 02, 2014 4:39 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Event Framework?
PostPosted: Tue Jun 19, 2012 7:18 pm 
Offline

Joined: Tue Jun 19, 2012 7:10 pm
Posts: 2
Hi all,

I'm developing an application that uses another event driving library (PJSIP) and I'm experiencing some problems.

Seams that I shouldn't call GTK+ funcs from other threads than the main gtk thread, so I did a hack with g_timeout_add() to get over this.

But now my app are showing some weird behaviour, things like showing the window but 'sometimes' not the inner widgets (yes, I'm using show_all()) even thou I know the code is being executed.

So my question is: What is the right way to tell GTK+ apps that another (not GTK) events has occurred?

I like to send some kind of "signal" in my code and then handle this signal on the gtk main thread. I think this might solve my problems...

Thanks.


Top
 Profile  
 
 Post subject: Re: Event Framework?
PostPosted: Tue Jun 19, 2012 7:59 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Hi,

Without knowing the structure of your application a bit more it is hard to tell what it is you are doing wrong. Maybe one possible problem is that you are not letting the GTK+ event loop take control to allow it to display all the widgets.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Event Framework?
PostPosted: Tue Jun 19, 2012 8:50 pm 
Offline

Joined: Tue Jun 19, 2012 7:10 pm
Posts: 2
I solved my issues by removing all calls to gtk functions from the code and moving the to separate functions.
Where they were called I added the g_idle_add() pointing to this newly created funcs.
Thanks


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 1 guest


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group