Greenfoot actor gets removed after compile - actor

I create a new scenario, add new world subclass, add a new actor subclass, then compile. I drag that new actor to the scenario and press the compile button and that actor disappears. Am I missing something here? I hope I am. I'm running this from the usb using the standalone version.

The actors you drag to the scenario are temporary - if you add them that way you have to drag them there each time you compile.
You've two options, either drag the actors where you want then right click the world and hit the "save the world" button, or edit the world's constructor to add your actors in where you want them.

Related

User story for drag and drop feature

Can anyone help me create a User Story for the dragging and dropping feature, where I can drag and drop projects from "New Project" to "In progress" etc Column
User-stories describes a feature from the user's point of view, making clear what the user wants to achieve. We cannot invent stories for your users: normally, you should discuss this with your users. But if you're learning and it could help, here an hypothetical example:
As a project manager I can drag a project icon in the "new project" column across my kanban board and drop it on the "in progress" column, so that I can easily and intuitively communicate that a project was started and is still going on.
Be aware that referring explicitly to a drag and drop seems very detailed and might not leave much room to propose better solutions. In this regard, you need to keep in mind that a story is not a detailed specification. It's just a placeholder for a conversation. Personally, I'd rather go for something simpler like:
As a project manager I can easily chose a project to launch and show that it is currently in-progress, so that the other users know on which project they may work.
I would then discuss with the user about the details of the story. Maybe drag and drop is the way to go. Maybe keyboard control (tab to select, space to chose target) is needed for accessibility reasons. But perhaps I'll discover that some users prefer to update the status in the project card if it's on the screen.
Anyhow, during this conversation you'd write down all the expectations, positive and negative, for the acceptance criteria. For example:
Dragging from "new" and dropping on "new" cancels the drag&drop operation
When dragging from "new" a visual feedback should be given to show the project moving
During the dragging, the use of the escape button may cancel the operation.
When the project is dropped by accident, the user may undo the operation.
When the project is successfully dropped on the "in progress" column, any open view of the project card should be immediately opened to show the new status of the project.
Attempting to drag a project, of which the user is not responsible, should lead to an error message about missing authorisations, etc.. .

Xcode Interface Builder - "correct" way to delete/rename miswired IBOutlets / IBActions?

I am new to Xcode, working through Swift, so I'm not sure if what I am decribing is actually a bug.
When using interface builder and the assistant editor, I can create lables, buttons etc, and create Outlets and Action in the code with a control-drag.
So long as I am perfect, no problem. But I seem to run into problems if, for example, I make a mispelling of the object name. Or, I choose outlet instead of action. I can't seem to find a way to make a correction that does't seem to totally screw up the IDE. Even if I delete the object in the IB and the code, it seems to leave problems behind when I build. Or, if I try to delete the line in code and re-drag it, a new line of code is created, but the object seems to now reference the new name, and the old, now missing name.
Again, I am working with Swift --- Since I don't use/know Objective-C I don't know if there is a similar behavior using that language.
Appreciate any pointers. (Other than don't use the Interface builder / storyboards / Swift.)
Use the Connections inspector to break the connection. Then you can modify/delete the object and/or the code without having to worry.
The accepted answer is fine, but there are a few ways to do the same thing.
Method One
Right click the view in the storyboard and then click the little x by the referencing outlet.
Method Two
Right click the view name in the Document Outline. Then click the little x by the referencing outlet.
Method Three
Select the view on the storyboard and then click the Connections Inspector. Then you can click the little x to remove an outlet reference.
Extra References in Code
If you are getting outlet connections in code that you didn't add yourself see this answer.
You can find unused IBOutlets in the file in which they're declared by looking in the "gutter" of the source editor for an "unfilled hole".

MFC Radio button freezes entire screen

I'm a bit at a loss here. Simply put, i created 2 radio buttons on my MFC GUI (vs2010) via the toolbox. I put each of them as a group so i could use the wizard to create a member variable for them. At this point, i run the code to test functionality. I don't expect much to happen since i don't have any handling code for the clicks, but what does happen is my entire screen freezes. So i click on either of the radio buttons, it shows that it is checked, but after that, i cannot click anything else on the screen. It has basically become frozen until i restart the program.
Has anyone seen this before?
.h file entry:
CButton testRadio;
CButton testRadio1;
.cpp file entry
DDX_Control(pDX, IDC_TEST_RADIO, testRadio);
DDX_Control(pDX, IDC_TESTRADIO1, testRadio1);
i know that the control ID's are not repeated, so that is not an issue.

Using edit menu commands from menu bar app

I have an app which is run from the menu bar only (LSUIElement is set in the info.plist) which means there is no main menu except the menu I attached to the status item. The problem is I would like to enable some edit commands when using an NSTextView (like command-c to copy) but all command keys seem to be disabled since the app is technically not active (I get beeps when trying any key combinations).
Is there anyway to add a standard edit menu somewhere and enable command keys that would redirect to it? I'm thinking there could be a hack to make the app temporarily active or something but I can't figure anything out.
Thanks.
They're not disabled. They're gone, because you deleted them.
You need to put back your Main Menu.
If you use version control, you may be able to resurrect it from the past using that. If not, you'll have to create a new project, copy anything custom from your Main Menu nib (if you even still have one) into that one, and move that nib into your actual project to be your new Main Menu nib.
The Edit menu commands, window-related commands (e.g., Close), and numerous other commands all live in the Main Menu. If you delete the Main Menu, you don't have those features anymore.
Your Main Menu isn't visible in a UI element app, but that's not a reason to delete it—it's a reason to keep it, even though your app won't have the menu bar, because not being visible means that it won't peek out from behind the curtain but will remain there keeping the magic of your keyboard shortcuts working.

Main menu in a FoxPro 9 app

If you use the Visual FoxPro 9 Application Framework to create a desktop standalone application and add a database and form, the exported exe shows a Quick Start on load which shows the form to select.
If one wants to show up his own MAIN MENU form on the exe load, what's the way to do it? Using Set Main on the Menu Form does not work.
Here is a visual representation of the idea.
In its simplest steps then, aside from the "Wizards" you can use to build forms and bind to data environments, tables, grids, etc maybe this will help.
Create an empty project.
CREATE PROJECT MyApp
Go to the documents tab and add a new form. Put a few buttons as you've described on it. One of the buttons, allow to close the form, such as "Exit". Double click this exit button and put in the code
CLEAR EVENTS
THISFORM.RELEASE()
Since there are no "data entry" elements on this form, we need something to make it keep focus. Buttons alone don't just "do" that. Go to the properties sheet of the form and go down to "Window Type" and set it to "Modal" - meaning, keep this form up until its intentionally closed. (This also keeps as a baseline for you calling any OTHER forms from this one for your application.) Save the form, such as "MyMainForm".
Click on the "Code" tab of the project and do a new "Program". In its simplest context, put in
DO FORM MyMainForm
READ EVENTS
Save the program, such as MyStartupProgram. Once saved in the project, right-click on this program and select "Set Main" for this to be considered the single entry point to your entire application. Save, build the project and run it. You should be good to go.

Resources