*

texus

  • *****
  • 1357
    • View Profile
    • Texus's Blog
Re: Clickable textbox
« Reply #15 on: 23 December 2018, 12:01:02 »
I'm not going to do that, if all goes well then it should be really fast without having to do something like a BeginUpdate/EndUpdate. I use the ListView regularly at work (in c++) and I'm always annoyed by how slow it is when adding data.
With SFML you control when things are drawn anyway so you don't have to "prevent drawing" during the update.

Adding several hundreds to a few thousands of lines is so slow that it feels like the list view is just badly optimized. But I guess it has to do with the way it is designed too. Yesterday I started writing the header file and I intended to keep a similar way of adding items as in the windows component, i.e. by having an Item struct containing the caption and subitems. While doing so I realized that although this would be easy for the user, it meant that the user could change an item without the widget knowing about it and the widget would have to update its internal list of items every frame. By not allowing direct access to the Item struct and providing functions like addSubItem and changeItem, the widget can keep full control of when an item changes and I can reduce the amount of work that has to be done every frame.

You can expect the same performance in the ListView than you get now in the ListBox. And I don't mean the 1.7 seconds to add 10000 items like in TGUI 0.7, I mean the 0.083 seconds that it takes in 0.8.