Re: [Glade-users] GtkListStore. (Multiple selection)



    Thanks for the suggestion. Dave dave<at>gurumeditation.it provided me with
a simple/good example.
     My problem is that, when using *foreach(); we cannot delete any rows
because the remove() messes up the iter on the store/model. Thus cuases some
rows to not be deleted and sometimes gives some ugly  error messages.
     I am trying to think of a way to mark the selectect rows -- and I guess I
found a obscure way that works: Add a non-visible flag on the model, and on the
foreach function, I set it to true (meaning it was selected -- after the
foreach call is done, I loop through the model and remove the rows I had set.

  Ugly, but it should work.

  Thank for the reply.

Harring.
     
    
--- Damon Chaplin <damon kendo fsnet co uk> wrote:
On Tue, 2002-10-15 at 02:34, Harring Figueiredo wrote:


 Folks,

 I have posted this before and got no answers. I am posting again :)

 I have a GtkListStore and would like to activate/deactive a button on the
toolbar if there is something select on the list. i.e: If any row(s) is
selected the "Delete Selected" button is active, else the button is
innactive.

 I have set up the GtkSelection to MULTIPLE. It seems that listening for
the
"changed" signal does not give me enough infrmation. (Even the doc says
that
the "changed" signal is just a hint.

  Has anyone implemented this type of behaviour on the GtkListStore.

 I have looked into all the Demos/example/docs and could not find anything
pointing to it. I even looked at some code fot the Selection and Gtkstore.

The "changed" signal of the GtkTreeSelection should work.
You may have to use gtk_tree_selection_selected_foreach() to determine
if any items are selected.

I don't know of any other way (but I'm not a GtkTreeView expert).

Damon


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com



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