minetest.explode textlist event

Description

 * Returns a table, e.g. {type="CHG", index=1}
 * type: "INV" (no row selected), "CHG" (selected) or "DCL" (double-click)

Example
Here is a real-world example with a code snippet from L-System Tree Utility 1.0.0, a mod providing a frontend to manage L-system trees:

Only the first 3 lines are of interest here. is a formspec element of type “textlist”. is used to fetch an event, in this case, the code checks whenever the user has selected another element in the list. The index is then used later to store it for later use. The last 2 lines are used to update the formspec and send it again to the user. In another part of the mod, the saved index is used to correctly pre-select the entry the user has selected previously when user decides to access this part of the frontend again.

Source: