Re: [Vala] [PATCH] gtk_action_group_add_*_actions add user_data



On Wed, Apr 2, 2008 at 1:13 PM, Juerg Billeter <j bitron ch> wrote:
On Wed, April 2, 2008 07:34, Jaap A. Haitsma wrote:
 > I've ran into an issue when using ActionGroup.add_toggle_actions or
 > ActionGroup.add_radio_actions. The field user_data is not being set by
 > the vala compiler so the C compiler complains. Attached patch should
 > resolve this I think. In my opinion it would be even better if the
 > user_data field was not there but that the vala compiler would
 > automatically set it to the this pointer. Is this possible?

 Thanks for the patch. It looks fine, I'll merge that as soon as possible.
 'this' might not always be the right choice, so I don't think we should do
 that.

For g_signal_connect functions (e.g. the callbacks of widgets) vala
doesn't let you specify user_data. The this pointer is just passed
automatically as user data. I was very surprised to see that I needed
to specify user data for add_actions. So for consistency I would
recommend not to pass user_data for add_actions. Furthermore without
it the use is easier.

Do you konw of an example why especially for actions passing user_data
will be handy? If the this pointer gets passed I just need to make the
data I need member of the class.

Jaap



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