Files
luban-lite-t3e-pro/packages/third-party/awtk-ui/awtk/design/default/ui/serial.xml

29 lines
902 B
XML
Raw Normal View History

2023-11-09 20:19:51 +08:00
<window>
<button text="打开设备" x="16" y="15" w="76" h="34" >
<property name="on:click">
var device = widget_get('device', 'text')
widget_set('serial','device', device)
</property>
</button>
<edit name="device" x="119" y="13" w="178" h="38" text="/dev/ttys028" />
<label name="recv" x="5" y="123" w="303" h="101" />
<edit name="send" text="hello serial" x="5" y="273" w="200" h="34" />
<button text="button" tr_text="send" x="220" y="274" w="81" h="34" >
<property name="on:click">
var os = widget_get('serial','ostream')
var msg = widget_get('send', 'text')
ostream_write_string(os, msg)
</property>
</button>
<serial name="serial">
<property name="on:data">
var is = widget_get('self','istream')
var msg = istream_read_string(is, 100, 0)
widget_set('recv', 'text', msg)
</property>
</serial>
</window>