Re: gtk_list_store_remove



--- Jeffrey Goddard <moosewood mooseroot org> wrote:
i have the following code snippet:
___________________________________________________
      GtkWidget *week_select_store;
      GtkTreeIter *row_pointer;
      gboolean ret_val_bool;

      ret_val_bool = gtk_tree_model_get_iter_first    \
              (GTK_TREE_MODEL(week_select_store), row_pointer);
      while(ret_val_bool)
      {
              ret_val_bool = gtk_list_store_remove    \
                              (GTK_LIST_STORE(week_select_store), row_pointer);
      }
___________________________________________________

I receive this compiler error:
sql_functions.c: In function `clear_display':
sql_functions.c:1067: void value not ignored as it ought to be

Line 1067 is the gtk_list_store_remove line in the while loop.

From the API docs:

Removes the given row from the list store. After being removed, iter is set
to 
be the next valid row, or invalidated if it pointed to the last row in 
list_store.

list_store : A GtkListStore
iter : A valid GtkTreeIter
Returns : TRUE if iter is valid, FALSE if not.

So, to my way of thinking (which is, of course, quite possibly in left 
field:>)) this should be quite valid code and the compiler should not be 
whining about it. Anyone got a clue what's going on, and can point me in a 
direction to remedy the problem?
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



Change To this and check to see if it works.

        GtkWidget *week_select_store;  <== Make sure this actually points to a store.
      GtkTreeIter row_pointer;   <== This should not be a poiter !!! else you will
have to allocate mem.
      gboolean ret_val_bool;

      ret_val_bool = gtk_tree_model_get_iter_first    \
              (GTK_TREE_MODEL(week_select_store),  &row_pointer /* This should be the
address &*/);   
        while(ret_val_bool)
        {
                ret_val_bool = gtk_list_store_remove    \
                                (GTK_LIST_STORE(week_select_store), &row_pointer  /* this again is the
address &*/);
        }

 
 Let me know the results.

 Hope this helps.

Harring.

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]