Re: Using Mono/C# to develop simple OSX app

"Edward Ned Harvey (mono)" <[email protected]>
Newsgroups gmane.comp.gnome.mono.general
Message-ID <BN3PR0801MB1154F8E15E4B7C59DE236963FA150@BN3PR0801MB1154.namprd08.prod.outlook.com>
> From: [email protected] [mailto:mono-list-
> [email protected]] On Behalf Of sams
> 
> I know this post is now forking off in all kinds of different directions but
> I just wanted to ask one more thing - the original app I was talking about
> now includes a loop that determines the size of files whose names are
> passed
> in via XML. This takes a little time to run so I'd like to add some progress
> bars. I got as far as adding them and writing the code to make them work but
> the UI does not refresh until the loop is completely finished (ie rather
> than incrementing bit by bit, the UI gets refreshed when the progress bar's
> value is set to the maximum so to the user they just appear to jump from
> beginning to end).
> 
> I have investigated a few asynchronous techniques but I have not had any
> luck. If anyone can shed some light on this, I'd be very grateful! When I
> used to program .net, the solution for me was a call to
> Application.DoEvents......

For this type of question, I've had the best luck asking in the Xamarin Mac forums. But if I remember when I get back here later, I'll try to answer here.

Short answer: It's very likely you're hogging the main thread. You need to release it and run on a different thread in order to let the main thread get back to the main run loop, where it handles things like GUI updates.
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.