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

Erik de Castro Lopo mle+tools at xxxxx
Tue Aug 10 00:41:35 UTC 2010

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


to get the int back.

Erik de Castro Lopo

More information about the Devel mailing list