Save a project where class has no instances and class not visible on re-open [FIXED?]

(Read-only) To re-open a bug, start a new thread in the Bugs forum.

Moderator: MSandro

Locked
MrSteve
Posts: 61
Joined: Jun 16th, '16, 01:22

Save a project where class has no instances and class not visible on re-open [FIXED?]

Post by MrSteve » Jul 31st, '16, 04:57

To recreate this:
1) Create a new project
2) Delete the instance of MyClass
3) Save project
4) Try and re-open project

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: Save a project where class has no instances and class not visible on re-open

Post by JohnM » Aug 1st, '16, 14:36

This bug appears to be fixed in v54. Is it?

MrSteve
Posts: 61
Joined: Jun 16th, '16, 01:22

Re: Save a project where class has no instances and class not visible on re-open [FIXED?]

Post by MrSteve » Aug 1st, '16, 16:56

Almost Fixed. So now if I save a project where there are no instances for a class, when I re-open the project the Class name does appear in the list.
But there exists one instance of the class. This is much better behavior, but one would expect if I save with no instances it would open with no instances instead of one. The main problem with opening with one instance, is the costume for that instance will appear on the screen.

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: Save a project where class has no instances and class not visible on re-open [FIXED?]

Post by JohnM » Aug 8th, '16, 00:46

What you're seeing is actually the intended behavior.

The idea is that if you want to try blocks in the palette, as you can do in Scratch, you need an instance to operate on. Thus, when you select a class that has no instances, GP creates one for you. This happens when you open a project and the selected class had no instances when the project was saved. It also happens if you select a class that currently has no instances -- GP makes one for you. Likewise, the clear button doesn't remove all instances, it removes all but one.

Obviously having instances automatically created can get annoying if you don't want them, but there may be a tradeoff here between the needs of the beginner, who may benefit from always having a concrete instance to operate on, and the the more advanced user.

For now, I suggest adding a little script to clear the stage when that's what you want:
ClearStage.png

Locked