Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions app/src/processing/app/Mode.java
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ public void rebuildExamplesFrame() {
if (visible) {
bounds = examplesFrame.getBounds();
examplesFrame.setVisible(false);
examplesFrame.dispose();
}
examplesFrame = null;
if (visible) {
Expand Down Expand Up @@ -691,11 +692,19 @@ public DefaultMutableTreeNode buildSketchbookTree() {

/** Sketchbook has changed, update it on next viewing. */
public void rebuildSketchbookFrame() {
boolean wasVisible =
(sketchbookFrame == null) ? false : sketchbookFrame.isVisible();
sketchbookFrame = null; // Force a rebuild
if (wasVisible) {
showSketchbookFrame();
if (sketchbookFrame != null) {
boolean visible = sketchbookFrame.isVisible();
Rectangle bounds = null;
if (visible) {
bounds = sketchbookFrame.getBounds();
sketchbookFrame.setVisible(false);
sketchbookFrame.dispose();
}
sketchbookFrame = null;
if (visible) {
showSketchbookFrame();
sketchbookFrame.setBounds(bounds);
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/processing/app/Sketch.java
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,10 @@ public void handleDeleteCode() {
// get the changes into the sketchbook menu
//sketchbook.rebuildMenus();

// make a new sketch, and i think this will rebuild the sketch menu
// make a new sketch and rebuild the sketch menu
//editor.handleNewUnchecked();
//editor.handleClose2();
editor.getBase().rebuildSketchbookMenus();
editor.getBase().handleClose(editor, false);

} else {
Expand Down