On Wed, 9 May 2001 11:00:50 +1000 , Bernie Maier said:

> > -----Original Message-----
>  > From: Ari Heitner [mailto:[EMAIL PROTECTED]]
>  > Sent: Wednesday, May 09, 2001 12:37 AM
>  > 
>  > On Tue, May 08, 2001 at 03:00:51PM +1000, Bernie Maier wrote:
>  [...]
>  > > Does anyone know if it is
>  > > possible to successfully embed Mozilla once the loop is running?
>  > > If so, how?  Every time I've tried, it hangs.
>  > 
>  > Uh, go back and read your Gtk programming basics.
>  
>  Fair call - I've only been using a library on top of GTK+ (wxWindows),
>  so haven't had to learn much raw GTK+.  However...
>  
>  > You can't (afaik) add widgets after gtk_main() is called. gtk_main never
>  > returns, and it expects all events to be registered so it can start the
>  > event loop and correctly notify people about things.
>  > 
>  > In general, you better call *any* gtk_whatever_new before gtk_main. Can
>  you
>  > give a counterexample that works?
>  
>  1. Pretty much the entire wxWindows library.  You can construct widgets
>  dynamically at runtime.  The rest of our application does this, quite
>  successfully.  I'm certain this boils down to calling gtk_whatever_new
>  once the event loop has started.  [Just verified by stepping through
>  with a debugger, running a wxWindows/GTK+ app that in response to
>  selecting a menu item, creates a button - gtk_button_new is called.]
>  2. I can't see how an application, like a browser, could ever open an
>  arbitrary number of windows if it can't create new frame windows.
>  Maybe there's some "class" registration that needs to be done before
>  the event loop, though?

so you are saying that from a menu item creating a gtkmozembed doesn't work?
after calling gtk_main(); it should work - I think what art meant here is that
you can't call functions after gtk_main(); as in code

ala

do stuff
gtk_main();
create embed here - ofcourse it'll fail.

However, You should be able to initlize embed from a menu item or a button or
any callback hooked to your gui once the gtk_main() loop is in effect.

Try gtk_moz_embed_push_startup(); before calling a gtk_moz_ebmed_new(); see if
that helps.

Maher


>  
>  > Maybe I'm just totally wrong though. But I've never seen an 
>  > example that does otherwise.
>  
>  Cheers,
>  
>      Bernie
>  
>  P.S. Another hint that I'm doing something wrong is probably the fact
>  that whenever I try and debug the embedding app using gdb, gdb hangs
>  during the XPCOM startup.
>  
>  

-- 
http://www.muhri.net -- [EMAIL PROTECTED]

Reply via email to