save treeview selection and remove images
- From: rupert <rupertt gmail com>
- To: gtk-app-devel-list gnome org
- Subject: save treeview selection and remove images
- Date: Fri, 24 Mar 2006 23:13:51 +0100
Hi,
this time i have two problems where i cant find any solution for.
first i create some images for different selections and I want to remove
these images for other selections,
3 stars are shown as a maximum, setting the images work, but i couldnt find
the right way to remove the pictures.
if(row2[0] != NULL)
{
favcount = atoi(row2[0]);
g_print("favcount: %d\n", favcount);
if(favcount == 1)
{
star = g_object_new(GTK_TYPE_IMAGE,"file", "pics/star.png",
NULL);
gtk_fixed_put(GTK_FIXED(data), star, 160, 330);
gtk_widget_set_size_request(star, 20, 20);
gtk_widget_show(star);
}
else if(favcount == 2)
{
star = g_object_new(GTK_TYPE_IMAGE,"file", "pics/star.png",
NULL);
gtk_fixed_put(GTK_FIXED(data), star, 160, 330);
gtk_widget_set_size_request(star, 20, 20);
gtk_widget_show(star);
star2 = g_object_new(GTK_TYPE_IMAGE,"file",
"pics/star.png", NULL);
gtk_fixed_put(GTK_FIXED(data), star2, 180, 330);
gtk_widget_set_size_request(star2, 20, 20);
gtk_widget_show(star2);
}
else if(favcount == 3)
{
star = g_object_new(GTK_TYPE_IMAGE,"file", "pics/star.png",
NULL);
gtk_fixed_put(GTK_FIXED(data), star, 160, 330);
gtk_widget_set_size_request(star, 20, 20);
gtk_widget_show(star);
star2 = g_object_new(GTK_TYPE_IMAGE,"file",
"pics/star.png", NULL);
gtk_fixed_put(GTK_FIXED(data), star2, 180, 330);
gtk_widget_set_size_request(star2, 20, 20);
gtk_widget_show(star2);
star3 = g_object_new(GTK_TYPE_IMAGE,"file",
"pics/star.png", NULL);
gtk_fixed_put(GTK_FIXED(data), star3, 200, 330);
gtk_widget_set_size_request(star3, 20, 20);
gtk_widget_show(star3);
}
}
else
{
gtk_widget_destroy(star);
}
the other thing is i would like to store the last position in a treeview and
start at this position the next time the programm is run.
thx
maybe i put this on sourceforge when its reached a userfriendly level ;)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]