Hi all,
I've been getting exasperated with HildonPickerButton: I have a
simple list of strings, and I want the user to select zero or more of them.
HildonPickerButton with multiple selection seems to be perfect for my
need, but unfortunately HildonPickerDialog doesn't allow closing the
dialog if no item is selected (why???).
The only workaround I could come up with, is connecting to the "changed"
signal of the HildonTouchSelector and in the handler run this code. I'm
pasting this here in case it turns out to be useful for someone else:
=============
static void
hack_sel(GtkWidget *selector, gint column, gboolean *hacked)
{
GtkWidget *dialog;
guint id, ret;
if (*hacked) return;
/* HILDON HACK: HildonPickerDialog blocks the emission of the
* "response" signal if no item is selected. Since this blocking
* happens on a signal handler for the "response" signal itself,
* we disconnect it :-) */
dialog = gtk_widget_get_toplevel(selector);
id = g_signal_lookup("response", GTK_TYPE_DIALOG);
ret = g_signal_handlers_disconnect_matched(dialog,
G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DATA, id, 0,
NULL, NULL, NULL);
if (ret != 1)
g_warning("%s: disconnected %u signals!", G_STRFUNC, ret);
*hacked = TRUE;
}
============
If someone has some better suggestion, you are most welcome to post it. :-)
Ciao,
Alberto
--
http://www.mardy.it <- geek in un lingua international!
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers