[Gtk-sharp-list] Table layout and cross-thread calling

Luciano _ lnc19 at hotmail.com
Tue Mar 13 08:25:15 EDT 2007

I learn to use Threading in Gtk, and it is really easy:

If it help, read it from my project svn page:

This is where i call the thread start

This is the method called:

I use an object to get all the info about the second thread, it has a 
constructor with all the info needed in the second thread (you cannot pass 
parameters to new ThreadStart(method)). I pass callback to return to 
previous thread, and i use Gtk.Application.Invoke to change the Gtk Thread.

You can even see a code with Monitor and Lock too:

I hope it helps.


>From: Walter Kempf <gtk-sharp at indicium.za.net>
>To: Aaron Oxford <aaron at hardwarehookups.com.au>
>CC: gtk-sharp-list at lists.ximian.com
>Subject: Re: [Gtk-sharp-list] Table layout and cross-thread calling
>Date: Tue, 13 Mar 2007 07:45:49 +0200
>MIME-Version: 1.0
>Received: from lists.ximian.com ([]) by 
>bay0-mc1-f18.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Mon, 
>12 Mar 2007 23:04:58 -0700
>Received: from galactus.ximian.com (localhost.localdomain [])by 
>lists.ximian.com (Postfix) with ESMTP id 2F6711CFC51;Tue, 13 Mar 2007 
>03:43:53 -0400 (EDT)
>Received: from herald.ximian.com (frontgate.ximian.com [])by 
>lists.ximian.com (Postfix) with ESMTP id 019B71CFC06for 
><gtk-sharp-list at lists.ximian.com>;Tue, 13 Mar 2007 03:43:51 -0400 (EDT)
>Received: by herald.ximian.com (Postfix, from userid 2601)id EE71B70039; 
>Tue, 13 Mar 2007 01:04:55 -0500 (EST)
>Received: from www26a.your-server.co.za 
>(www26a.your-server.co.za[])by herald.ximian.com (Postfix) with 
>ESMTP id C0BE870035for <gtk-sharp-list at lists.ximian.com>;Tue, 13 Mar 2007 
>01:04:51 -0500 (EST)
>Received: from c1-212-1.tbnb.isadsl.co.za 
>([]helo=[])by www26a.your-server.co.za with 
>esmtpa (Exim 4.63)(envelope-from <gtk-sharp at indicium.za.net>)id 
>1HQzog-0008JU-FR; Tue, 13 Mar 2007 07:44:58 +0200
>X-Original-To: gtk-sharp-list at lists.ximian.com
>Delivered-To: gtk-sharp-list at lists.ximian.com
>X-Greylist: delayed 1183 seconds by postgrey-1.27 at 
>frontgate.ximian.com;Tue, 13 Mar 2007 01:04:51 EST
>User-Agent: Thunderbird (X11/20070221)
><30658. at www.hardwarehookups.com.au>
>X-Authenticated-Sender: walter at opmind.co.za
>X-Virus-Scanned: Clear (ClamAV 0.88.4/2830/Tue Mar 13 07:12:22 2007)
>X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on 
>X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=MY_OBFUX 
>X-BeenThere: gtk-sharp-list at lists.ximian.com
>X-Mailman-Version: 2.1.8
>Precedence: list
>List-Id: "Discussion of the .Net bindings for 
><http://lists.ximian.com/mailman/listinfo/gtk-sharp-list>,<mailto:gtk-sharp-list-request at lists.ximian.com?subject=unsubscribe>
>List-Archive: <http://lists.ximian.com/pipermail/gtk-sharp-list>
>List-Post: <mailto:gtk-sharp-list at lists.ximian.com>
>List-Help: <mailto:gtk-sharp-list-request at lists.ximian.com?subject=help>
><http://lists.ximian.com/mailman/listinfo/gtk-sharp-list>,<mailto:gtk-sharp-list-request at lists.ximian.com?subject=subscribe>
>Errors-To: gtk-sharp-list-bounces at lists.ximian.com
>Return-Path: gtk-sharp-list-bounces at lists.ximian.com
>X-OriginalArrivalTime: 13 Mar 2007 06:04:59.0074 (UTC) 
>Seeing as I've dabbed in multi-threading myself (albeit not with that
>much success), I can point you to
>If you search through the various threading issues described previously
>in this list, it seems that the Gtk.Application.Invoke(delegate {...})
>path is the most favored (also covered in the "Responsive Applications"
>Hope this helps,
>Aaron Oxford wrote:
> > Hi all,
> >
> > I'm still making great progress with my app, but I've found another 
>couple of things that are
> > confusing me.
> >
> > First and foremost, I seem to be getting extremely strange behaviour 
>modifying a label from
> > another thread. The code crashes more often than not. This is unusual 
>for a threading problem
> > because generally the chances of a problem occurring are very small. In 
>any case, what is the
> > accepted method for modifying Widgets from other threads?
> >
> > Also, the table layout seems to be playing up very badly. I declare an 
>Nx3 table and fill it up
> > with components but they all appear on top of each other, no matter what 
>I do with packing, size
> > hints or Show vs ShowAll. I'm struggling a lot with this completely 
>uncontrollable layout
> > philosophy - is there really no way to control the relative proportions 
>of components as they
> > scale? It seems that if I create two thin columns and one fat one, 
>stretching the window leaves me
> > with three columns of equal width.
> >
> > Apologies for posting even more newbie questions, thanks in advance for 
>any help.
> >
> >
>Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com

MSN Latino: el sitio MSN para los hispanos en EE.UU. http://latino.msn.com/

More information about the Gtk-sharp-list mailing list