#!/usr/bin/env entity children_attrib ("selected", "true"); foreach $child (@children) { print "children_attrib selected $child\n"; } my @children = $node->children_attrib_rx ("selected", "[tT].*"); foreach $child (@children) { print "children_attrib_rx selected $child\n"; } print ("selection - $x,$y to $x1,$x2\n"); } sub set_graph { $value += 1.1; $color += 2; if ($color > 99) { $color = 0; } $color_str = sprintf ("#2030%02d", $color); enode("graph-point.foo1")->attrib("y" => $value); enode("graph-point.foo2")->attrib("y" => $value + 3); enode("graph-point.foo3")->attrib("y" => $value + 5); enode("graph-point.foo4")->attrib("y" => $value + 7); enode("graph-point.foo4")->attrib("color" => $color_str); if ($value > 30) { enode("timer.t")->attrib("interval" => "-1"); } } sub do_button_press { my ($node, $bnum) = @_; print "bnum = $bnum\n"; if (3 == $bnum) { my $menu = enode ("menu.test"); $menu->attrib("popup" => "true") if $menu; } } sub print_selection { my $node = enode ("graph.mygraph"); my @children = $node->children(); my $child; foreach $child (@children) { if ($child->attrib_is_true ("selected") ) { print "SELECTED $child\n\n"; } } } ]]>