Re: GSignal connect with struct *pointer



No! This takes no effect. Isn't it the same? I tried your
suggestion but noting is better. And i think it's no metter
to use '&struct' or '*struct'. The problem is that
g_signal_connect() is unable to give the adress of 'struct'
to the callback function. Maybe the gpointer has no
possibility to transport the location of a structure variable.
Have no more idea. What's wrang here?
    
Mathew
    
On Saturday August 09 2003 13:57 CEST, Leandro A. F. Pereira 
wrote:
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

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
    



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]