Re: Signal of a button dynamically created
- From: David Nečas <yeti physics muni cz>
- To: Borja Mon Serrano <borjamonserrano gmail com>
- Cc: gtk-app <gtk-app-devel-list gnome org>
- Subject: Re: Signal of a button dynamically created
- Date: Mon, 28 Oct 2013 17:20:46 +0100
On Mon, Oct 28, 2013 at 04:22:38PM +0100, Borja Mon Serrano wrote:
The point here is: how can I know what button was pressed in order to
remove a row?
(a) by passing something that identifies the button within user_data
when you do g_signal_connect...
(b) using something along the lines of g_object_set_data(button, "id", ...)
to give each button an identifier and retrieving it in the signal
handler
(c) by keeping the buttons in some data structure (list, hash table,...)
and identifying them by the object address in the signal handler
There are other methods, but these are probably typical.
Yeti
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]