Change TreeItem value Lua

asked 2025-08-26 17:13:52 +0000

Omi gravatar image

We are researching how to add composite values to the protocol tree. It would be ideal to parse the child fields first and update the parent "composite". One thing that is missing is a set_value(). Is there a method to update the "show" value in the protocol tree.

Here is an example of an output in PDML:

    <field name="cme.futures.ilink3.sbe.v8.5.timetoexpiration" showname="Time To Expiration: " size="5" pos="247" show="" value="ffffff7f7f">
      <field name="cme.futures.ilink3.sbe.v8.5.mantissa32" showname="Mantissa 32: No Value" size="4" pos="247" show="2147483647" value="ffffff7f"/>
      <field name="cme.futures.ilink3.sbe.v8.5.exponent" showname="Exponent: No Value" size="1" pos="251" show="127" value="7f"/>
    </field>

Is there a way to update the show="" attribute of the parent? We could generate 2 separate reader functions as an alternate.

Thanks in advance

edit retag flag offensive close merge delete

Comments

(Related to Update parent tree node)

WSDG: 12.7.1. TreeItem
Would 12.7.1.4. treeitem:set_text(text) or 12.7.1.15. treeitem.text work?

Chuckc gravatar imageChuckc ( 2025-08-26 18:23:36 +0000 )edit

When I tried:

time_to_expiration:set_text("O'Doyle Rules")

I got:

<field name="cme.futures.ilink3.sbe.v8.5.timetoexpiration" showname="O'Doyle Rules" size="5" pos="247" show="" value="ffffff7f7f">
Omi gravatar imageOmi ( 2025-08-26 18:36:56 +0000 )edit