Re: Can't correctly set data to an object (button)
- From: Sven Neumann <sven gimp org>
- To: philippe vivarelli mindspeed com
- Cc: gtk-list gnome org
- Subject: Re: Can't correctly set data to an object (button)
- Date: 31 Jul 2002 14:57:25 +0200
Hi,
philippe vivarelli mindspeed com writes:
> Well I have toggle button to wich I attached a default string ("DEFAULT")
> using the gtk_object_set_user_data function.
>
> In the callback toggle function I reassign this string regarding the state
> of the button.
>
> I pick up the new string from a gtk_entry.
you use gtk_entry_get_text() which returns a pointer to the string
owned by the GtkEntry. This pointer becomes invalid as soon as the
text in the entry changes. You'll want to g_strdup() it and use
g_object_set_data_full() with g_free() as destroy notifier.
Salut, Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]