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: 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(), but I don't know which

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

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 question

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

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' failed Maybe