Re:getting position in a treeview list (1 viewing) (1) Guest
Favoured: 0
|
|
|
TOPIC: Re:getting position in a treeview list
|
neil (User)
Senior Boarder
Posts: 53
|
|
getting position in a treeview list 1 Year, 8 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.
|
neil (User)
Senior Boarder
Posts: 53
|
|
Re:getting position in a treeview list 1 Year, 8 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.
|
|
|
|
|