GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Sep 20, 2014 5:57 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: gtktreeview selection
PostPosted: Sun Dec 23, 2012 8:32 am 
Offline
Familiar Face

Joined: Mon Oct 29, 2012 1:30 pm
Posts: 16
good morning to everybody

i already asked about another argument in this forum (and Paul Childs is helping me) but i have also another problem

in gtk2 i use gtktreeview (with gtkliststore as object) with multiple selection. i implemented "changed" signal to find which rows are selected. when i use a simple 'click' on list i can find the right numbers of rows selected (1)

but if i use also shift and control keys to select more rows i find a wrong number of selections. to find how many rows i selected i use "gtk_tree_selection_count_selected_rows" and "gtk_tree_selection_get_selected_rows" and what happens is the following:

at 1st simple selection i find 1 row selected (ok)
changing selection (simple selection) i find 1 row selected (ok)
using shift key and selecting (for example) 5 rows i obtain 1 row selected (ko)
then i use ctrl key to remove 1 selection and i obtain 5 rows selected (ko, as previous state)
using ctrl again so select a new line i obtain 4 row selected (ko, as previous state)

in conclusion, using shift or ctrl key modificators, rows counting functions are "late" en respect the real situation

did you verify a similar behaviour? is it a problem solved with gtk3?

thanks in advance
wally

p.s.
xmas is next to us, so i wish you a merry xmas


Top
 Profile  
 
 Post subject: Re: gtktreeview selection
PostPosted: Thu Jan 10, 2013 8:08 am 
Offline
Familiar Face

Joined: Mon Oct 29, 2012 1:30 pm
Posts: 16
no one realizes the same thing?


Top
 Profile  
 
 Post subject: Re: gtktreeview selection
PostPosted: Thu Jan 10, 2013 7:12 pm 
Offline
Familiar Face

Joined: Thu Aug 27, 2009 9:44 pm
Posts: 21
It would be a great help (probably not only for me) if you could provide a minimal working example which illustrates your observation.

In order to get help as fast as possible the example should be readily compilable for everyone who's trying to help you.

At least i would be happy to tell you whether i observe the same behavior you've described. If so i could test if gtk3 lead to the same situation, as well.

I'm looking forward to your code...


Top
 Profile  
 
 Post subject: Re: gtktreeview selection
PostPosted: Wed Jan 16, 2013 7:07 pm 
Offline

Joined: Tue Jan 15, 2013 8:20 pm
Posts: 2
Hello,
i have the same problem!
I use vala 0.18 and gtk 2.22 on OpenSuse 11.3 and made the gui with glade 3.8.2
when i set selection to multiple the treeselection (count_selected_rows and get_selected_rows) is always one click behind the treeview.

if i set set_rubber_banding to true and use the ugly gray retangle to select entrys treeview and treeselection are synchronous.

When i have time i make a example for illustration.


Top
 Profile  
 
 Post subject: Re: gtktreeview selection
PostPosted: Wed Jan 16, 2013 7:58 pm 
Offline

Joined: Tue Jan 15, 2013 8:20 pm
Posts: 2
I have found a solution:

don't connect to treeview curser_changed
connect to treeview_get_selection changed


Top
 Profile  
 
 Post subject: Re: gtktreeview selection
PostPosted: Sun Feb 10, 2013 12:10 pm 
Offline
Familiar Face

Joined: Mon Oct 29, 2012 1:30 pm
Posts: 16
goodmorning to everybody

@saunderson
sorry. i left this topic for too time and i didn't see your note. to do now what you ask i have to post all my program; i will try to "cut" the code and post it

@andreas
i tryed to find your "treeview_get_selection changed" function but i didn't find it. can you please check for the rigth name?

thanks
wally


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group