[Geany-devel] [PATCH 19/19] Use per document indent sizes

Lex Trotman elextr at xxxxx
Tue Aug 10 08:44:32 UTC 2010


On 10 August 2010 18:22, Jiří Techet <techet at gmail.com> wrote:
> On Tue, Aug 10, 2010 at 02:41, Erik de Castro Lopo
> <mle+tools at mega-nerd.com> wrote:
>> Lex Trotman wrote:
>>
>>> While this works fine and the handlers are only one line each, another
>>> way would have been to use one handler and set different user_data for
>>> each menu item.
>>
>> To be explicit, you can do:
>>
>>   g_signal_connect ((gpointer) indent_width_1, "activate",
>>                    G_CALLBACK (on_indent_width_activate),
>>                    GUINT_TO_POINTER (1));
>>
>>   g_signal_connect ((gpointer) indent_width_2, "activate",
>>                    G_CALLBACK (on_indent_width_activate),
>>                    GUINT_TO_POINTER (2));
>>
>>
>> and in the on_indent_width_activate() callback use
>>
>>   GPOINTER_TO_INT(user_data)
>>
>> to get the int back.
>
> Sure, you can do it when connecting callbacks to signals manually. But
> how do you do this with glade (2.12)? I was searching for some
> possibility to pass user data but without any success and that's why I
> decided first to check the labels and later to use different
> callbacks. I think it's not possible - no other glade-defined callback
> in geany uses callback data either.

Oh yeah, now I remember why I don't like Glade :-)

Cheers
Lex

>
> Jiri
>
>>
>> Erik
>> --
>> ----------------------------------------------------------------------
>> Erik de Castro Lopo
>> http://www.mega-nerd.com/
>> _______________________________________________
>> Geany-devel mailing list
>> Geany-devel at uvena.de
>> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>>
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>



More information about the Devel mailing list