Commit 190fd653 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

add keyboard shortcut for clearing console to pd window and canvas window

parent c4a8fd97
......@@ -445,6 +445,10 @@ function nw_create_pd_window_menus(gui, w) {
}
}
});
minit(m.edit.clear_console, {
enabled: true,
click: pdgui.clear_console
});
if (osx) {
minit(m.edit.reselect, { enabled: false });
}
......@@ -455,12 +459,6 @@ function nw_create_pd_window_menus(gui, w) {
minit(m.edit.font, { enabled: false });
minit(m.edit.cordinspector, { enabled: false });
}
minit(m.edit.clear_console, {
click: function() {
var container = w.document.getElementById("p1");
container.textContent = "";
}
});
minit(m.edit.find, {
click: function () {
var find_bar = w.document.getElementById("console_find"),
......
......@@ -822,9 +822,13 @@ function nw_create_patch_window_menus(gui, w, name) {
}
}
});
minit(m.edit.clear_console, {
enabled: true,
click: pdgui.clear_console
});
minit(m.edit.reselect, {
enabled: true,
click: function () { pdgui.pdsend(name, "reselect"); }
click: function() { pdgui.pdsend(name, "reselect"); }
});
minit(m.edit.tidyup, {
enabled: true,
......
......@@ -158,13 +158,13 @@ function create_menu(gui, type) {
}));
}
editMenu.append(new gui.MenuItem({ type: "separator" }));
if (!canvas_menu) {
editMenu.append(m.edit.clear_console = new gui.MenuItem({
label: l("menu.clear_console"),
tooltip: l("menu.clear_console")
}));
editMenu.append(m.edit.clear_console = new gui.MenuItem({
label: l("menu.clear_console"),
tooltip: l("menu.clear_console"),
key: "l",
modifiers: "shift+" + cmd_or_ctrl
}));
editMenu.append(new gui.MenuItem({ type: "separator" }));
}
if (canvas_menu) {
editMenu.append(m.edit.tidyup = new gui.MenuItem({
label: l("menu.tidyup"),
......
......@@ -315,6 +315,13 @@ function gui_post_error(objectid, loglevel, errormsg) {
}
}
function clear_console() {
var container = pd_window.document.getElementById("p1");
container.textContent = "";
}
exports.clear_console = clear_console;
// convert canvas dimensions to old tcl/tk geometry
// string format. Unfortunately this is exposed (and
// documented) to the user with the "relocate" message
......
Markdown is supported
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