[Glade-users] xlib error corba/glademm app



Okay so answering my own question here is the
solution. 

This isn't a glade problem (but since I originally
posted here I post the followup.)

The problem is with matching 

        gdk_threads_enter / gdk_threads_leave


But what wasn't clear was how to implement this.

It is documented on the gtk web site though.


gtk_main() must be surrounded by 

        gdk_threads_enter / gdk_threads_leave

   gdk_threads_enter();
   gtk_main();
   gdk_threads_leave();

So it looks like what happens in gtk_main() is 
(assuming -- haven't got the source)

gtk_main(){
... // global lock active
... // no other threads can update.
while(true){
// other threads are still blocked
  switch(event){
  // widget events in gtk do X updates.

  }
  gdk_threads_leave();
... // no X updates allowed from gtk
... // other threads get their turn.
  gdk_threads_enter();
}

The reason that I write back about this is that
there is a post somewhere (can't remember which)
that claims that this enclosure of main blocks all
other updates.

The sample code at

        www.gtk.org/faq

Uses this model.

At   any  rate   this  completely eliminates   the
problem,   whether I  have  understood the   model
correctly or not.

Thanks, and sorry to bother anyone.

-- 
/^\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL  
/ \ 






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]