mail-archives/gtk-sharp-list/2007-January/007705.html

133 строки
3.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Application.Invoke
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Application.Invoke&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="007685.html">
<LINK REL="Next" HREF="007686.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Application.Invoke</H1>
<B>gemini64</B>
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Application.Invoke&In-Reply-To="
TITLE="[Gtk-sharp-list] Application.Invoke">robby.schillinger at t-online.de
</A><BR>
<I>Tue Jan 9 03:00:12 EST 2007</I>
<P><UL>
<LI>Previous message: <A HREF="007685.html">[Gtk-sharp-list] Advanced/Outlook-ish Calendar Widgetry
</A></li>
<LI>Next message: <A HREF="007686.html">[Gtk-sharp-list] Application.Invoke
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7705">[ date ]</a>
<a href="thread.html#7705">[ thread ]</a>
<a href="subject.html#7705">[ subject ]</a>
<a href="author.html#7705">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>
Hi there,
I use a thread, wich does some Application.Invoke.
The Thread itself works properly and the invokes are done.
But ...
the invoked delegates are only executed when some keystrokes or mousemoves
are done.
I also tried to use TimeoutHandlers, but received the same behavior.
Some suggestions for that ?
Thanks a lot
namespace MySpace
{
class MainClass
{
public static void Main(string[] args)
{
Gtk.Application.Init();
MainWindow win = new MainWindow();
win.Show();
Gtk.Application.Run();
}
}
public class MainWindow : Gtk.Window
{
private Thread testThread;
public MainWindow()
: base(&quot;MyWindow&quot;)
{
testThread = new Thread(doTest);
// testThread.IsBackground = true;
testThread.Start();
}
private void doTest()
{
#if DEBUG
Console.WriteLine(&quot;Starting update test-thread&quot;);
#endif
try
{
while (true)
{
Thread.Sleep(1000);
Gtk.Application.Invoke(this.doUpdate);
#if DEBUG
Console.WriteLine(&quot;Call Gtk.Application.Invoke(...) &quot;);
#endif
}
}
catch (ThreadAbortException e)
{
Console.WriteLine(&quot;UpdateThread - caught ThreadAbortException -
resetting.&quot;);
}
}
private void doUpdate(object sender, System.EventArgs args)
{
#if DEBUG
Console.WriteLine(&quot;App-Invokation does some work &quot;);
#endif
Thread.Sleep(100);
}
}
}
--
View this message in context: <A HREF="http://www.nabble.com/Application.Invoke-tf2944404.html#a8233455">http://www.nabble.com/Application.Invoke-tf2944404.html#a8233455</A>
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="007685.html">[Gtk-sharp-list] Advanced/Outlook-ish Calendar Widgetry
</A></li>
<LI>Next message: <A HREF="007686.html">[Gtk-sharp-list] Application.Invoke
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7705">[ date ]</a>
<a href="thread.html#7705">[ thread ]</a>
<a href="subject.html#7705">[ subject ]</a>
<a href="author.html#7705">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">More information about the Gtk-sharp-list
mailing list</a><br>
</body></html>