Re: Change the behaviour of a button

2005-12-23 Thread David Rosal
Chad Robinson wrote: David Rosal wrote: Ok. Then I wanted to be able to stop the file removing with the same button, so I wanted it to have the label "Stop" and the "Stop" gtk icon inside. I know how to change the callbacks with g_signal_block() and g_signal_unblock(), bu

Change the behaviour of a button

2005-12-23 Thread David Rosal
Hi. In my gtk app I have a long list of files that I want to remove. I have a button with the label "Remove" and the icon of a trash bin beside the label. I have put both together in a GtkBox and I've packed the GtkBox into the button with gtk_container_add(). Then I've g_signal_connect()'ed the

Re: Memory question

2005-09-28 Thread David Rosal
Colossus wrote: Hi, Am I doing the same ( memory leaking ) with g_strdup_printf ? If so what is the better way to write the following code: ? response = ShowGtkMessageDialog (GTK_WINDOW (MainWindow),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK, g_strdup_printf ("%s",g_strerror(er

Re: Memory question

2005-09-28 Thread David Rosal
Allin Cottrell wrote: gchar *text = g_strdup_printf("banana %d", i); gtk_entry_set_text(GTK_ENTRY(entry), text); g_free(text); Is the above code really safe? You're passing the address of "text" to the function gtk_entry_set_text(). Next you g_free() that address, so AFAIK the memory manag

Memory question

2005-09-27 Thread David Rosal
Hello. I know this is a general C programming issue, but... It is a memory leak to call g_strdup() as argument to other function? For example, if I do this: gtk_entry_set_text(GTK_ENTRY(entry), g_strdup("banana"); Am I leaking memory? AFAIK, the above code makes glib (via libc): 1) ask the k

GLib gettext and UTF-8

2005-09-27 Thread David Rosal
Hi. I don't know much about UTF8 issues, and I wanted to know if I am making the things well. In my GTK2 program, I use the macro _(str) to translate the strings. "str" is in english (ASCII), but the translation may be encoded in an arbitrary codeset (e.g. ISO-8859-1 or KOI-8...). The questio

Re: How to get the first visible row in a tree view?

2005-03-13 Thread David Rosal
Gabriel de Perthuis wrote: Le dimanche 13 mars 2005 Ã 20:59 +, David Rosal a Ãcrit : It works! It gives me a valid path and I can retrieve the filename. But I get this warning: Gtk-CRITICAL **: gtk_tree_view_get_path_at_pos: assertion `tree_view->priv->bin_window != NULL' fa

Re: How to get the first visible row in a tree view?

2005-03-13 Thread David Rosal
works! It gives me a valid path and I can retrieve the filename. But I get this warning: Gtk-CRITICAL **: gtk_tree_view_get_path_at_pos: assertion `tree_view->priv->bin_window != NULL' failed I can't guess what could it mean. [ excuse me Gabriel for the flood of emails ]

How to get the first visible row in a tree view?

2005-03-13 Thread David Rosal
w the contents of the first visible row in a tree view? Thanks. -- David Rosal <[EMAIL PROTECTED]> -- ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list