[MonoDevelop] Closing dialog windows from my addin freezes MonoDevelop

Lluis Sanchez lluis at ximian.com
Mon Oct 3 11:41:26 EDT 2005


I agree with what Todd said. This call to Threads.Enter should not be
needed. Try something: call DispatchCommand from a method invoked
through GLib.Idle, and see if it works in this way.

El dv 30 de 09 del 2005 a les 14:08 -0400, en/na Scott Ellington va
escriure: 
> I figured this out.  It was a threading issue.  I needed to call
> Gdk.Threads.Enter() and Leave() as so:
> 
> Gdk.Threads.Enter();
> Runtime.Gui.CommandService.CommandManager.DispatchCommand(FileCommands.NewProject);
> Gdk.Threads.Leave();
> 
> Would it be a good idea for DispatchCommand to call these methods?
> 
> Scott
> 
> On Sun, 2005-09-25 at 21:04 -0400, Scott Ellington wrote:
> > All,
> > 
> > My addin is a welcome page for MonoDevelop.  It uses gecko#, and when a
> > certain link is clicked, I intercept the OpenUri to spawn a MonoDevelop
> > Gui command, such as:
> > 
> > Runtime.Gui.CommandService.CommandManager.DispatchCommand(FileCommands.NewProject);
> > 
> > This opens successfully, but when I try to either close it by clicking
> > the "New" or "Cancel" buttons, the window does not close and MonoDevelop
> > freezes.  This also occurs when I use FileCommands.OpenFile.  Strangely,
> > HelpCommands.TipOfTheDay, closes correctly.  
> > 
> > I'm not familiar with writing desktop apps, but I thought it might be a
> > threading issue.  So I tried wrapping the event handler as suggested in
> > the following:
> > http://deobald.glcn.com/wiki/index.php/Thread_management_in_MonoDevelop
> > without success.  I also checked to see if gecko# was spawning a thread
> > for the OpenUri event and it seems that my event handler is in the Gui
> > thread, so I can't see what the problem might be.
> > 
> > Finally I tried creating and destroying my own sample Gtk window without
> > any problem.  Anybody have any ideas, or other things to try next?
> > 
> > thanks in advance,
> > Scott Ellington
> > 
> > 
> > _______________________________________________
> > Monodevelop-list mailing list
> > Monodevelop-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/monodevelop-list



More information about the Monodevelop-list mailing list