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:
parent
153f8a8aed
commit
c1754859e3
1 changed files with 20 additions and 7 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue