Blady-Com / gnoga

gnoga - The GNU Omnificent GUI for Ada
GNU General Public License v3.0
11 stars 4 forks source link

Store selected card tabs locally. #11

Open liampwll opened 1 week ago

liampwll commented 1 week ago

This significantly improves performance when many tabs are present as we do not need to send a request to query each one.

This has only been tested on my fork, but I don't see any changes that could cause issues at a glace.

Blady-Com commented 6 days ago

Thanks for your improvement proposal.

I'm wondering about side effects. Especially when Tab object is on the stack and removed at the end of a subroutine. For example in Layout, Tab is removed at the end of On_Connect.

liampwll commented 5 days ago

We could check the background colour in Tab_Selected with an and then, which avoid any issues with a new tab being allocated at the same address and would still improve performance. This does not deal with the user messing with the elements outside of the procedures provided by Gui.View.Card, but I'm not sure if it's reasonable to worry about that.

Blady-Com commented 3 days ago

I guess one may always worry about user troubling ideas :-) What about storing Gnoga unique ID?

liampwll commented 2 days ago

Would this cause issues if the user specifies an ID themselves or is reusing IDs already disallowed?