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

Merge branch 'startup-fixes'

parents 7476eae5 d200a723
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
<input style="display:none;" id="saveDialog" type="file" nwsaveas /> <input style="display:none;" id="saveDialog" type="file" nwsaveas />
<div id = "console_bottom"> <div id = "console_bottom">
<div id = "printout"> <div id = "printout">
<pre id="p1" <pre id="p1" style="white-space: pre-wrap;"></pre>
style="white-space: pre-wrap;">Welcome to Pd GUI using Node-Webkit
<script>document.write(process.versions['node-webkit'])</script><br/></pre>
</div> </div>
</div> </div>
<div id="console_find" style="display:none;"> <div id="console_find" style="display:none;">
......
...@@ -62,11 +62,6 @@ function set_vars(win) { ...@@ -62,11 +62,6 @@ function set_vars(win) {
// nw context callbacks (mostly just creating/destroying windows) // nw context callbacks (mostly just creating/destroying windows)
pdgui.set_new_window_fn(nw_create_window); pdgui.set_new_window_fn(nw_create_window);
pdgui.set_close_window_fn(nw_close_window); pdgui.set_close_window_fn(nw_close_window);
if (!font_engine_sanity) {
pdgui.post("warning: your system's font stack is maintained by troglodytes.");
} else {
pdgui.post("font stack check: using optimal font sizes.");
}
} }
function app_quit() { function app_quit() {
...@@ -743,12 +738,25 @@ function nw_create_pd_window_menus(gui, w) { ...@@ -743,12 +738,25 @@ function nw_create_pd_window_menus(gui, w) {
}); });
} }
function post_startup_messages() {
// These will be the first messages printed to the main Pd window.
// Later let's use a link to the docs for new users.
pdgui.post("Welcome to Purr Data");
// Warn the user if the font sizes aren't optimal. Font sizes which
// aren't optimal result in extra space at the end of object/message
// boxes
if (!pdgui.get_font_engine_sanity()) {
pdgui.post("warning: your system's font stack is not optimal");
}
}
function gui_init(win) { function gui_init(win) {
set_vars(win); set_vars(win);
add_events(); add_events();
nw_create_pd_window_menus(gui, win); nw_create_pd_window_menus(gui, win);
// Set up the Pd Window // Set up the Pd Window
gui.Window.get().setMinimumSize(350, 250); gui.Window.get().setMinimumSize(350, 250);
post_startup_messages();
// Now we create a connection from the GUI to Pd, in one of two ways: // Now we create a connection from the GUI to Pd, in one of two ways:
// 1) If the GUI was started by Pd, then we create a tcp client and // 1) If the GUI was started by Pd, then we create a tcp client and
// connect on the port Pd fed us in our command line arguments. // connect on the port Pd fed us in our command line arguments.
......
{ {
"hello": "world",
"iem": { "iem": {
"prop": { "prop": {
"heading": { "heading": {
......
...@@ -127,6 +127,9 @@ exports.set_font_engine_sanity = function(win) { ...@@ -127,6 +127,9 @@ exports.set_font_engine_sanity = function(win) {
font_engine_sanity = false; font_engine_sanity = false;
} }
canvas.parentNode.removeChild(canvas); canvas.parentNode.removeChild(canvas);
}
exports.get_font_engine_sanity = function() {
return font_engine_sanity; return font_engine_sanity;
} }
......
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