Re: GSignal connect with struct *pointer
- From: "Leandro A. F. Pereira" <leandro linuxmag com br>
- To: gtk-app-devel-list gnome org
- Subject: Re: GSignal connect with struct *pointer
- Date: Sat, 9 Aug 2003 08:57:39 -0300
Quoted by a can full of super chickens
For `Matthias Mann <matman matman24 org>'
On Saturday, 09 August 2003 (08:40):
Is it impossible to give a pointer of 'struct any_struct' to
g_signal_connect() for user data?
Sure it's possible :)
typedef struct _MyStruct MyStruct;
Change it to:
struct _MyStruct {
GtkWidget *treeView;
GtkTreeStore *treeStore;
.... some more widgets...
};
And:
MyStruct *struct;
struct = g_new0(MyStruct, 1);
g_signal_connect(G_OBJECT(struct.treeView),
"row-expanded",
G_CALLBACK(tree_callback),
struct);
It should work now ;)
--
Leandro Pereira (oO) <leandro linuxmag com br>
/||\ www.mindcrisis.tk
"Alguns homens vêem as coisas como são, e dizem 'Por quê?'
Eu sonho com as coisas que nunca foram e digo 'Por que não?'"
--George Bernard Shaw
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]