PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:getting position in a treeview list (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:getting position in a treeview list


#1358
neil (User)
Senior Boarder
Posts: 50
graphgraph
User Offline Click here to see the profile of this user
getting position in a treeview list 1 Year, 2 Months ago Karma: 1  
Hi,

I have a treeview list inside a scrolledwindow, and not all the rows in the list are visible at any one time.

Is there any way to tell which rows in the list are currently visible to the user ??

Neil.
 
  The administrator has disabled public write access.

#1363
neil (User)
Senior Boarder
Posts: 50
graphgraph
User Offline Click here to see the profile of this user
Re:getting position in a treeview list 1 Year, 2 Months ago Karma: 1  
I've got a start.
The row number of the current first visible row (regardless of the position scrolled to in the list) can be obtained by:

$view->get_path_at_pos(0,1);
$path = $path_array[0][0];

$path now contains the row number of the currently first visible row.

Now I want to find the row number of the current last visible row.

Any ideas, please ??

I think it will be a calculation something like:
'height of scrolled window' / 'height of row' plus 'row number of the currently first visible row'.

Right now, I don't know if I can get 'height of scrolled window' or 'height of row', so I'm back to google.


(By the way, in the above code, it's unclear to me why
$view->get_path_at_pos(0,0);
doesn't work 100% of the time.)
whereas
$view->get_path_at_pos(0,1);
seems to).

Neil.
 
  The administrator has disabled public write access.



Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2009. kksou.com. All Rights Reserved