1
0
Fork 0

update widget every two seconds in addition to the usual updates. This

works for tied() properties, too. Search for "update_interval" and set
it to 0 if you don't want these updates at all.
This commit is contained in:
mfranz 2006-05-23 20:30:32 +00:00
parent 153f8a8aed
commit c1754859e3

View file

@ -88,7 +88,8 @@
var input = dlg.getNode("input", 1);
var list = dlg.getNode("list", 1);
var node = nil;
var dir = "/";
var dir = nil;
var update_interval = 2;
update = func(w) {
fgcommand("dialog-update", props.Node.new({"object-name": w,
@ -123,10 +124,10 @@
update("input");
} else {
var name = node.getName();
var i = node.getIndex();
var index = node.getIndex();
var type = node.getType();
if (i) {
name ~= "[" ~ i ~ "]";
if (index) {
name ~= "[" ~ index ~ "]";
}
label.setValue(squeeze(name, 30));
var value = nil;
@ -152,16 +153,28 @@
}
}
var active = 1;
auto_update = func {
if (active and update_interval) {
list.setValue(dir);
update("property-list");
settimer(auto_update, update_interval);
}
}
if (dlg.getNode("last") != nil) {
dir = dlg.getNode("last").getValue();
list.setValue(dir);
node = props.globals.getNode(dir);
} else {
dir = "/";
}
list.setValue(dir);
selected();
update("list");
update("property-list");
auto_update();
</open>
<close>
active = 0;
dlg.getNode("last", 1).setValue(dir);
</close>
</nasal>