januz
(Diego Gangl)
May 24, 2023, 11:12pm
1
Hi Guys, I’m working on a rather complex listview with a GtkTreeListModel and when filling the model with random test data I’ve found this issue:
It looks like the listview isn’t rendering all the rows, or triggering a re-render as I scroll. Any ideas what could be causing this? I’ve been at this for a while
Relevant code is here:
"""Find an item in TreeRow widget (sometimes nested)."""
item = row.get_item()
while type(item) is not expected_type:
item = item.get_item()
return item
class TaskPane(Gtk.ScrolledWindow):
"""The task pane widget"""
def __init__(self, browser, pane):
super(TaskPane, self).__init__()
self.ds = browser.app.ds
self.app = browser.app
self.browser = browser
self.pane = pane
self.searching = False
2 Likes
antoniof
(António Fernandes)
May 30, 2023, 3:02pm
2
row.get_item() in gtk 4.8 doesn’t work as expected (e.g. when sorting), it should be fixed in 4.10.
januz
(Diego Gangl)
June 2, 2023, 10:17pm
3
Hey, thanks for replying but I’m running Fedora 38 (GTK 4.10)
azmeuk
(Éloi Rivard)
June 7, 2023, 4:27pm
4
Hi diego,
I tried to reproduce the bug you are describing on your gtk4 branch, but so far I did not encountered glitches, even if I am not sure what to expect and how to provoke it
GTG (debug version, “random” dataset) v0.6-296-gfe121e84
CPython 3.11.3 (main, Apr 5 2023, 15:52:25) [GCC 12.2.1 20230201]
GTK 4.10.4, GLib 2.76.2
PyGLib 3.44.1, PyGObject 3.44.1
Linux-6.3.6-arch1-1-x86_64-with-glibc2.37
januz
(Diego Gangl)
June 8, 2023, 6:42pm
5
Thanks. I’ve noticed that it happens at around +204 tasks. If you have 205 for instance, you’ll see an empty row at the bottom. At 206, you’ll see two and so on.
Neui
(Neui)
June 9, 2023, 12:24am
6
It appears to be the box between the scrolled window and the list view itself to be the problem.
The following patch makes it work for me:
diff --git a/GTG/gtk/browser/task_pane.py b/GTG/gtk/browser/task_pane.py
index 303cd966..4c2c2e58 100644
--- a/GTG/gtk/browser/task_pane.py
+++ b/GTG/gtk/browser/task_pane.py
@@ -204,9 +204,12 @@ class TaskPane(Gtk.ScrolledWindow):
view.add_controller(key_controller)
view.connect('activate', self.on_listview_activated)
- wrap_box.append(title_box)
- wrap_box.append(view)
- self.set_child(wrap_box)
+ if False:
+ wrap_box.append(title_box)
+ wrap_box.append(view)
+ self.set_child(wrap_box)
+ else:
+ self.set_child(view)
self.set_title()
I created an example program that shows the problem, and the issue indeed appears at around 205 entries.
1 Like
system
(system)
Closed
July 17, 2023, 10:46pm
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.