![]() |
HildonTouchSelector and gtk_list_store_clear
I noticed a behavior that I believe was introduced in the recent updates of SDK to PR1.2. I have used gtk_list_store_clear to clear a list store associated with a touch selector. Now it seems that gtk_list_store_clear emits several times the "value-changed" signal for the picker button of the touch selector. I tried to block the signal by using g_signal_handlers_block_by_func/g_signal_handlers_unblock_by_func around gtk_list_store_clear but the signal is still emitted.
Here is a simple example which should demonstrate the behaviour. Code:
/* Code:
gcc -o hildon-touch-selector-example hildon-touch-selector-example.c `pkg-config gtk+-2.0 hildon-1 --cflags --libs` -Wall Have I understood something wrong? I wouldn't like to use the "changed" callback for the touch selector since it created some problems in my code (not the simple example above). |
Re: HildonTouchSelector and gtk_list_store_clear
Isn't the typical wisdom that if you're going to change the backing store, detach it from the display part first, do the change and then re-connect it?
This is what I've seen recommended for GtkTreeViews, for example. |
Re: HildonTouchSelector and gtk_list_store_clear
Quote:
Anyway, I solved the problem with g_signal_handlers_block_by_func. In the example above, the first argument to g_signal_handlers_block_by_func should be GTK_WIDGET(user_data) which is a pointer pointing to the picker button. I my bigger program I also missed to notice that you must have both the function name and the user argument right. |
Re: HildonTouchSelector and gtk_list_store_clear
I had the same problem since PR 1.2
(But I do not have much experience with gtk, so this may be in fact another problem or just my fault). I tried to detach the selector from the liststore by setting the current model to NULL, and then clear the liststore. But this gives some warning from the touch selector (invalid iterator). Finally I got it working by deselecting any touch selector row. (set selected row to -1). Maybe this helps nicolai |
Re: HildonTouchSelector and gtk_list_store_clear
Quote:
|
Re: HildonTouchSelector and gtk_list_store_clear
Quote:
:D |
All times are GMT. The time now is 00:49. |
vBulletin® Version 3.8.8