Commit 4ded064e authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

fix regression where glist_select can send messages to the GUI before the...

fix regression where glist_select can send messages to the GUI before the window or its elements actually exist. (Same thing happens in Vanilla, but tcl/tk silently ignores tk canvas itemconfigure messages for non-existent objects)
parent 8488c17b
......@@ -1833,12 +1833,21 @@ function gui_text_redraw_border(cid, tag, x1, y1, x2, y2) {
}
function gui_gobj_select(cid, tag) {
var g = get_gobj(cid, tag);
var g;
// We need to check if the window exists, because Pd will send
// messages to select the object before it (or the window) actually exists
// For example, this happens when using the "Find" menu. If Pd finds the
// match in a subpatch that isn't visible, it will open the subpatch and
// try to select the matching object before the subpatch has been mapped.
if (patchwin[cid]) {
g = get_gobj(cid, tag);
if (g !== null) {
g.classList.add("selected");
} else {
console.log("text_select: something wrong with group tag: " + tag);
}
}
}
function gui_gobj_deselect(cid, tag) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment