Allegro question, how can I get rid of the cmd window? - command

I've made a small game in Allegro, but every time I run the .exe file it opens both the allegro window for the graphics but also a command line window even though I don't have anything that prints to it.
It's kind ugly to have the cmd window next to the game window, so I wonder is there any way to not show it?

This really isn't specific to Allegro. The behavior is dependent on your compiler's linker settings.
Under gcc it is:
-Wl,--subsystem,windows
For MSVC:
/SUBSYSTEM:WINDOWS
If you use an IDE, look somewhere under the linker settings. It may also be referred to as something like "console" vs "windows (or GUI) application." You'll want the latter.

Here is a specific solution for C++ in Visual Studio Community 2022.
Right click on the project with you entry point and select "Properties". Under "Linker" and "System", change the row named "SubSystem" into "Windows (/SUBSYSTEM:WINDOWS)"
Source: https://www.allegro.cc/forums/thread/607888

Related

CLIPS: Clear-window in CLIPSDOS.exe and tab to indent in CLIPSIDE

With CLIPS, It's possible some of the following?? (V 6.4 for Windows)
1 - Use a command like (clear-window) in the CLIPSDOS console for clear the console.
2 - Use tabs for indentation in CLIPSIDE. When i press tab, cursor goes to File menu item... how to indent?
How do people learn programming with CLIPS? I'm using a plugin for Visual Studio that helps me with the parenthesis concordance, let me use tabs to indent, and other tricks. But it has some problems, and i'm quite worried about the usability of the CLIPSDOS and CLIPSIDE interfaces to this purpose.
Thanks in advance.
In CLIPSDOS, you can use the command (system cls) to clear the screen. This will simply call out to DOS to execute a cls command.
The IDEs use standard text editing classes for the CLIPS command prompt window. Tabs appear to work correctly on the macOS IDE, but not the Windows or Java Swing IDEs, so that will need to be corrected.
While you can directly enter constructs at the command prompt, it's better to edit them in a file with your preferred text editor and then use the load command from the command prompt to load the contents of that file. The IDE supports a command history so you can use the up/down arrow keys to cycle through prior commands to avoid retyping.

Cant find the java projects window in vscode

So I'm on vscode with the extension Project Manager for Java but i can only occasionally see the java projects window on the side bar. I check the three dots, nothing. Open view, nothing. The extension is on and enabled. I would show images, but the photos I took apparently take too much space. I can't figure out a difinitive way to restart vscode or the extension, just closing/disabling and opening/enabling
Ok, so turns out you have to open a java file. THEN it opens all the java extensions. That's really dumb and I hope they change that at some point.

How to set window size and position in Visual Studio Code?

Is it possible to set the VS Code window size and position, either via settings.json, though an extension, or by some other mechanism?
In Atom, I can do this in my init.coffee file as such:
atom.commands.add 'atom-workspace',
'custom:prepare-for-screencast': ->
atom.setSize(1280, 720)
atom.setPosition(37, 50)
Then I can call Prepare for screencast from the Command palette.
Not...yet?
https://code.visualstudio.com/docs/getstarted/settings
The closest I can find is window.newWindowDimensions, which only takes a few strings that refer to predefined geometries, although 'inherit' could serve you well in the meantime if you prime the pump by closing al your existing sessions, opening one window, sizing it to your liking, then quitting. Then all your new windows should be that size, and Visual Studio Code seems to be very well behaved with respect to resizing, just never close a resized window last, or it becomes your new default!
As for position, there appears to be nothing at all.
in vscode, go to
settins=>windw=>new window => new window dimension
there you are able to choose the following option to set the default dimensions, if vscode is getting opened:
inherit || offset || maximized || fullscreen
I prefer to use "inherit", i.e. open vs-code always as large as the previous one.
Start Visual Studio Code.
Click on "File"
Click on "Preferences"
Click on "Settings"
Write " window.newWindowDimensions " in the search box.
Select the value "inherit" from the drop down box.
That's it...!
If you're on a Mac, you can use this AppleScript snippet:
tell application "System Events" to tell process "Code"
tell window 1
set size to {1080, 720}
set position to {0, 0}
end tell
end tell
Not a general solution, but works well if you only need it when recording screencasts.
One way I found to solve this was by using the Developer Tools Console:
Help -> Toggle Developer Tools -> Console Tab
Type: window.resizeTo(1900, 1060);
Press Enter
Note: Tested on Windows 10, Ubuntu, OSX
Sidenote: Ubuntu had some strange behaviour bringing up the menu and developer tools. I had to open the developer tools while maximized, then undock the developer tools, then unmaximize the window, then type the command.
atom.commands.add 'atom-workspace',
'custom:prepare-for-screencast': ->
atom.setSize(1280, 720)
atom.setPosition(37, 50)
Then I can call Prepare for screencast from the Command palette.
This is really a good idea and a good feature to add to VSCode.
More important to me is "atom.setSize(1280, 720)"
Hope someone will be able to port this to VSCode.
"window.newWindowDimensions": "maximized"
Placing the following to settings.json is a good programmatical solution.
"window.newWindowDimensions": "offset",
The comment in the defaultSettings.json file says:
inherit: Open new windows with same dimension as last active one.
offset: Open new windows with same dimension as last active one with an offset position.
Basically the inherit option opens new windows completely overlapping to the current window, while the offset option opens new windows with around 50 px size of offset (depends on your screen size) from top/left.
I personally prefer "offset" but these two are essentially almost same.

Can the console in Eclipse pop up the way it does in Visual Studio

In Eclipse the console is embedded within the interface, but in Visual Studio it pops up whenever the code is compiled. Is there anyway to make this happen in Eclipse as well?
Short Answer No!
Long answer, you can try to change the behavior a bit. As those two are totally different Tools behavior is also different.
Change the settings of console at:
Window->Preferences->Run/Debug->Console
And open/close console or other views from Window->Show View

Xcode: finding a variable value while setting a breakpoint

I am a seasoned Visual Studio programmer, and when I set a breakpoint, I can open an intermediate window and type ?variableName to view the current value of the variable.
In Xcode however, I can't seem to find an equivalent. I can hover over the variable name when stepping through the code, but long strings are truncated in the view.
Is there an Xcode equivalent to the intermediate window of Visual Studio? If not, how can I set a breakpoint and watch the value (the full value in the case of longer strings)?
Many thanks,
Brett
Use the console window (under the Run menu - choose "Show console") and then it's a gdb debugger. Then you can issue:
po variableName
Another way is to hover over the variable, right-click (or [Ctrl]+[left-click]) and choose "Print Description". The output will be sent to the gdb console.
There is a debugger GUI you can open by clicking the little spray bottle next to the step commands (or through Run > Debugger). It has a GUI window with pretty much all the objects in the frame you're looking at and the current call stack.