Re: Help with a multi-threaded application. Spot a crash.

2012-06-01 Thread jcupitt
Hi again Osmo, On 31 May 2012 17:50, Osmo Antero wrote: > Jcupitt: > Ok, g_idle_add() seems to need protection by gdk_threads_enter() and > leave(). > Ref: > http://developer.gnome.org/gdk/stable/gdk-Threads.html#gdk-threads-add-idle That's out of date. g_idle_add() does not need any locking by

Multiple selections in list/treeview widgets and accelerator groups?

2012-06-01 Thread James Tappin
Is it possible that having an accelerator group associated with the top-level window of a hierarchy could prevent multiple selections in a list widget within that window from working? I have an application that is supposed to have multiple selections enabled (gtk_tree_selection_set_mode(selection,

Identifying a structure by reading it's first field.

2012-06-01 Thread Osmo Antero
Hello, I have couple of C structures that I want to distinguish between by reading the structures' first (type) field. typedef enum {NODE_1, NODE_2} NodeType; typedef struct { NodeType type; gchar *title; } Group; typedef struct { NodeType type; gchar *url; gint id; } Station

Re: Help with a multi-threaded application. Spot a crash.

2012-06-01 Thread Chris Vine
On Fri, 1 Jun 2012 09:23:35 +0100 jcup...@gmail.com wrote: > Hi again Osmo, > > On 31 May 2012 17:50, Osmo Antero wrote: > > Jcupitt: > > Ok, g_idle_add() seems to need protection by gdk_threads_enter() and > > leave(). > > Ref: > > http://developer.gnome.org/gdk/stable/gdk-Threads.html#gdk-threa

Re: Help with a multi-threaded application. Spot a crash.

2012-06-01 Thread jcupitt
On 1 June 2012 20:41, Chris Vine wrote: > jcup...@gmail.com wrote: >> That's out of date. g_idle_add() does not need any locking by you. > > I think you may be confusing this with the fact that with glib >= 2.32 > it is no longer necessary to call g_thread_init() to make glib thread > safe, which

Re: Help with a multi-threaded application. Spot a crash.

2012-06-01 Thread Chris Vine
On Fri, 1 Jun 2012 22:00:35 +0100 jcup...@gmail.com wrote: > On 1 June 2012 20:41, Chris Vine wrote: > > jcup...@gmail.com wrote: > >> That's out of date. g_idle_add() does not need any locking by you. > > > > I think you may be confusing this with the fact that with glib >= > > 2.32 it is no long

Re: Identifying a structure by reading it's first field.

2012-06-01 Thread Ernie Wright
On 6/1/2012 2:17 PM, Osmo Antero wrote: > I have couple of C structures that I want to distinguish between by > reading the structures' first (type) field. [...] > > Q: Can I assume that the "type" field is always first in the > structures, so I can read it with: NodeType type = *(NodeType*)nod