Commit eee1f25d authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

put resize_window in pdgui module

parent faabb8d9
......@@ -519,13 +519,13 @@ function cancel() {
}
}
function resize_window() {
var w = document.body.scrollWidth,
h = document.body.scrollHeight,
win = pdgui.get_dialogwin(pd_object_callback);
win.width = w;
win.height = h;
}
//function resize_window() {
// var w = document.body.scrollWidth,
// h = document.body.scrollHeight,
// win = pdgui.get_dialogwin(pd_object_callback);
// win.width = w;
// win.height = h;
//}
function populate_array_form(arrays) {
var arrays_select, a_field = document.getElementById('arrays');
......@@ -593,7 +593,7 @@ function register_canvas_id(gfxstub, attr_arrays) {
// labels and form elements. That makes it more efficient and
// snappier, at least on older machines.
document.getElementsByClassName('container')[0].style.setProperty('display', 'inline');
resize_window();
pdgui.resize_window(pd_object_callback);
}
function tr_text(id) {
......
......@@ -224,6 +224,7 @@ function register_canvas_id(gfxstub, attr_array) {
// snappier, at least on older machines.
document.getElementsByClassName('container')[0]
.style.setProperty('display', 'inline');
pdgui.resize_window(pd_object_callback);
}
function tr_text(id) {
......
......@@ -476,13 +476,13 @@ function cancel() {
pdgui.pdsend(pd_object_callback + " cancel");
}
function resize_window() {
var w = document.body.scrollWidth,
h = document.body.scrollHeight,
win = pdgui.get_dialogwin(pd_object_callback);
win.width = w;
win.height = h;
}
//function resize_window() {
// var w = document.body.scrollWidth,
// h = document.body.scrollHeight,
// win = pdgui.get_dialogwin(pd_object_callback);
// win.width = w;
// win.height = h;
//}
// This gets called from the nw_create_window function in index.html
// It provides us with our window id from the C side. Once we have it
......@@ -504,7 +504,7 @@ function register_canvas_id(gfxstub, attr_array) {
// labels and form elements. That makes it more efficient and
// snappier, at least on older machines.
document.getElementsByClassName('container')[0].style.setProperty('display', 'inline');
resize_window();
pdgui.resize_window(pd_object_callback);
}
function tr_text(id) {
......
......@@ -399,14 +399,14 @@ function cancel() {
//pdgui.pdsend(pd_object_callback + " cancel");
}
function resize_window() {
var w = document.body.scrollWidth,
h = document.body.scrollHeight,
win = pdgui.get_dialogwin(pd_object_callback);
win.width = w;
win.height = h;
pdgui.gui_post("w is " + w + " and h is " + h);
}
//function resize_window() {
// var w = document.body.scrollWidth,
// h = document.body.scrollHeight,
// win = pdgui.get_dialogwin(pd_object_callback);
// win.width = w;
// win.height = h;
//pdgui.gui_post("w is " + w + " and h is " + h);
//}
function change_api(elem) {
var id = elem.getAttribute('id'),
......@@ -530,7 +530,8 @@ function audio_prefs_callback(attrs) {
// have the side-effect of setting the dev to 'None')
set_chans('in', get_attr('pd-inchans', attrs));
set_chans('out', get_attr('pd-outchans', attrs));
resize_window();
pdgui.resize_window(pd_object_callback);
}
function set_devs(type, devs) {
......@@ -564,7 +565,8 @@ function midi_prefs_callback(attrs) {
get_attr('current-api', attrs)
);
}
resize_window();
pdgui.resize_window(pd_object_callback);
}
......
......@@ -3524,7 +3524,7 @@ gui_post("did is " + did + " and dialogwin[did] is " + dialogwin[did]);
function gui_font_dialog(cid, gfxstub, font_size) {
var attrs = { canvas: cid, font_size: font_size };
dialogwin[gfxstub] = nw_create_window(gfxstub, 'font', 265, 540, 20, 20, 0,
dialogwin[gfxstub] = nw_create_window(gfxstub, 'font', 265, 265, 20, 20, 0,
0, 1, 'white', 'Properties', '', 0, null, attrs);
}
......@@ -3840,3 +3840,10 @@ exports.dialog_bindings = function(did) {
}
};
}
exports.resize_window = function(did) {
var w = dialogwin[did].window.document.body.scrollWidth,
h = dialogwin[did].window.document.body.scrollHeight;
dialogwin[did].width = w;
dialogwin[did].height = h;
}
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