[Gambas-bugtracker] Bug #1626: Possible bug in .List.Extract( ) Method of ListBox object

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Wed Jul 17 12:30:20 CEST 2019


Comment #1 by Tobias BOEGE:

This is deliberate. The List property of ListBox returns a *copy* of the internal
string array, so any change you make is done to the copy. This is often done in
Gambas to prevent code from outside of an object to mess with its internal state.

If you extract elements from the List object directly, the object is not notified
of a change being made to its data, so it won't update its GUI accordingly.
You should assign the result of .List.Extract back into .List. Assignment to a
property is something an object is notified of.

You can imagine that there are other scenarios where objects want to only return
value copies of their internal state. Basically anytime the object makes assumptions
on and relies on the integrity of its state.

Tobias BOEGE changed the state of the bug to: Invalid.

More information about the Bugtracker mailing list