[Glade-users] string
- From: johnp martianrock com (John (J5) Palmieri)
- Subject: [Glade-users] string
- Date: Sat, 10 Jan 2004 11:51:28 -0500
You may wat to post this to the gtk-app-devel-list. Also posting your
maj_tle function would help. Without it I can only guess that you are
doing something with the string that the GtkEntry widget does not like.
The string returned by get_text is still owned by the GtkEntry and can
not be freed. Also if you free the GtkEntry widget somewhere in the
function the value returned will be pointing to deallocated memory. The
best thing to do is to strdup the value returned by get_text and then
free it after the function returns.
--
J5
On Sat, 2004-01-10 at 11:15, christophe Meyer wrote:
Hi,
I simply want to use a string comming from a gtk entry, in a classical
c function but it doesn't work and makes me a segmentation fault :(
This is a part of my callbacks.c file:
void
on_bouton_maj_clicked(GtkButton *button,
gpointer user_data)
{
GtkWidget * entry = lookup_widget(GTK_WIDGET(button), "url_maj");
maj_tle(gtk_entry_get_text(GTK_ENTRY(entry)));
}
The function maj_tle() needs as only parameter a classical char *string
and writes it in file using fopen(), fprintf() ...
For example if i use maj_tle("example") it works.
What should i do to solve that ?
Thanks for your help :)
_______________________________________________
Glade-users maillist - Glade-users lists ximian com
http://lists.ximian.com/mailman/listinfo/glade-users
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]