[MonoDevelop] Closing dialog windows from my addin freezes MonoDevelop

Scott Ellington scottellington at comcast.net
Fri Sep 30 14:08:17 EDT 2005


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
-- 
Scott Ellington <scottellington at comcast.net>



More information about the Monodevelop-list mailing list