File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -656,6 +656,7 @@ public void rebuildExamplesFrame() {
656656 if (visible ) {
657657 bounds = examplesFrame .getBounds ();
658658 examplesFrame .setVisible (false );
659+ examplesFrame .dispose ();
659660 }
660661 examplesFrame = null ;
661662 if (visible ) {
@@ -691,11 +692,19 @@ public DefaultMutableTreeNode buildSketchbookTree() {
691692
692693 /** Sketchbook has changed, update it on next viewing. */
693694 public void rebuildSketchbookFrame () {
694- boolean wasVisible =
695- (sketchbookFrame == null ) ? false : sketchbookFrame .isVisible ();
696- sketchbookFrame = null ; // Force a rebuild
697- if (wasVisible ) {
698- showSketchbookFrame ();
695+ if (sketchbookFrame != null ) {
696+ boolean visible = sketchbookFrame .isVisible ();
697+ Rectangle bounds = null ;
698+ if (visible ) {
699+ bounds = sketchbookFrame .getBounds ();
700+ sketchbookFrame .setVisible (false );
701+ sketchbookFrame .dispose ();
702+ }
703+ sketchbookFrame = null ;
704+ if (visible ) {
705+ showSketchbookFrame ();
706+ sketchbookFrame .setBounds (bounds );
707+ }
699708 }
700709 }
701710
Original file line number Diff line number Diff line change @@ -657,9 +657,10 @@ public void handleDeleteCode() {
657657 // get the changes into the sketchbook menu
658658 //sketchbook.rebuildMenus();
659659
660- // make a new sketch, and i think this will rebuild the sketch menu
660+ // make a new sketch and rebuild the sketch menu
661661 //editor.handleNewUnchecked();
662662 //editor.handleClose2();
663+ editor .getBase ().rebuildSketchbookMenus ();
663664 editor .getBase ().handleClose (editor , false );
664665
665666 } else {
You can’t perform that action at this time.
0 commit comments