Re: Signal of a button dynamically created



Le 28/10/2013 16:22, Borja Mon Serrano a écrit :
[...]

The point here is: how can I know what button was pressed in order to
remove a row?

When you connect a handler to a signal, there is a "data" parameter,
just pass in some info identifying the row through it:

        g_signal_connect(button, "clicked", G_CALLBACK(your_handler),
GUINT_TO_POINTER(row_id))

Alternatively, you can add arbitrary data associated with a widget,
using ::set_data(), so you could pass the row info through this too:

        g_object_set_data(button, "row-id", GUINT_TO_POINTER(row_id));

Regards,
Colomban


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