diff --git a/pd/nw/pd_canvas.js b/pd/nw/pd_canvas.js index 7753dfbd796c8675b71c017536008ddb1593816e..1aa6ddbc04dfb4c4e4809b47136dd0e0e10d0d24 100644 --- a/pd/nw/pd_canvas.js +++ b/pd/nw/pd_canvas.js @@ -1030,9 +1030,11 @@ function register_window_id(cid, attr_array) { // For now, there is no way for the cord inspector to be turned on by // default. But if this changes we need to set its menu item checkbox // accordingly here - //set_cord_inspector_checkbox(); + // set_cord_inspector_checkbox(); - // One final kludge-- because window creation is asyncronous, we may + // Set scroll bars + pdgui.canvas_set_scrollbars(cid, !attr_array.hide_scroll); + // One final kludge-- because window creation is asynchronous, we may // have gotten a dirty flag before the window was created. In that case // we check the title_queue to see if our title now contains an asterisk // (which is the visual cue for "dirty") diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js index d4ed129192c2543d228700adc1034d3b7289db45..1a4001d0e6d47f4e0a679ffaf4f08e2ba7a341e4 100644 --- a/pd/nw/pdgui.js +++ b/pd/nw/pdgui.js @@ -976,6 +976,17 @@ function gui_canvas_set_cordinspector(cid, state) { patchwin[cid].window.set_cord_inspector_checkbox(state !== 0 ? true : false); } +function canvas_set_scrollbars(cid, scroll) { + patchwin[cid].window.document.body.style. + overflow = scroll ? "visible" : "hidden"; +} + +exports.canvas_set_scrollbars = canvas_set_scrollbars; + +function gui_canvas_set_scrollbars(cid, no_scrollbars) { + canvas_set_scrollbars(cid, no_scrollbars === 0); +} + exports.menu_send = menu_send; function gui_set_toplevel_window_list(dummy, attr_array) { @@ -1417,7 +1428,8 @@ function gui_canvas_new(cid, width, height, geometry, zoom, editmode, name, dir, dirty: dirty_flag, args: cargs, zoom: zoom, - editmode: editmode + editmode: editmode, + hide_scroll: hide_scroll }); } diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c index 14ad4af98b965b00e257abd8baa71948665f6b28..736a9dbd9e460f746515548b285c1fee1ea94dde 100644 --- a/pd/src/g_canvas.c +++ b/pd/src/g_canvas.c @@ -744,8 +744,8 @@ void canvas_scalar_event(t_canvas *x, t_symbol *s, int argc, t_atom *argv) void canvas_show_scrollbars(t_canvas *x, t_floatarg f) { -post("setting noscroll to %d", f); x->gl_noscroll = (int)f; + gui_vmess("gui_canvas_set_scrollbars", "xi", x, (int)f); } void canvas_show_menu(t_canvas *x, t_floatarg f) diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index 61e9c6330196f26849b9c4b319fdf63e66460fe6..abea628172d14a05e7690a1065069106540dd0da 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -2767,7 +2767,8 @@ static void canvas_donecanvasdialog(t_glist *x, xmargin = atom_getfloatarg(9, argc, argv); ymargin = atom_getfloatarg(10, argc, argv); - x->gl_noscroll = atom_getintarg(11, argc, argv); + pd_vmess(&x->gl_pd, gensym("scroll"), "f", + atom_getfloatarg(11, argc, argv)); x->gl_nomenu = atom_getintarg(12, argc, argv); /* parent windows are treated differently than applies to