XCode - GUI options (font size) and block comment with /* */ and other editor features for C code

Hi,


I'm new to X Code (and MacOS). I've used extensively IDEs such as Eclipse and others on Linux and Windows (and even UNIX).


(1) Block comment with /* */ and other standard features for coding:

I've been searching for a way to comment blocks of code with /* */ .

I know about the combination Cmd + / , but it only comments out a line or more with //.

The information I find on the internet seems to not match the menus I see in my XCode.


I cannot find options for Edit Menu as in https://apple.stackexchange.com/questions/214236/xcode-comment-selection-shortcut-not-working-on-european-keyboard/214243 (Structure, Code Folding, Syntax Coloring).


(2) Font size in Xcode menus:

I've been using glasses for near vision for the last months, and I'm really struggling with to read the menus of Xcode (main preferences as well as settings of a project, which have even smaller font sizes).

I don't think it is not possible to change, taking into consideration that Mac products are well known for its well-thought GUI, but I just cannot find how to change it.


With Cmd+'+' I can increase the size of the code in the Editor Window. But for the Menus I haven't found anything.


Can you help me on that? Or give a hint about what is possible and what not.


many thanks

Joan


Xcode 12.0

MacOS Monterey 12.2.1 (21D62)

Mac mini, macOS 12.2

Posted on Feb 15, 2022 7:34 AM

Reply

Similar questions

7 replies

Feb 15, 2022 8:35 AM in response to Joan_14

1) That's old-school programming. The hip, young kids only use // comments. For something like this, you will have to write a text service using Automator. There are instructions here: https://stackoverflow.com/questions/13212288/is-there-a-shortcut-to-make-a-block-comment-in-xcode. Note that most of the answers in that thread are wrong. The only one that will work is the text service.



Joan_14 wrote:

that Mac products are well known for its well-thought GUI

That hasn't been true for a long time now. Go to System Preferences > Displays and choose a "scaled" resolution. That will give you bigger text in the menus.

Feb 16, 2022 1:19 AM in response to etresoft

As I am new to MacOS, I search how to exactly create an automator script (mentioned in the stack overflow thread, (see link above)

https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/CreateaScript.html


How to create a service:

on run {input, parameters}

return "/*\n" & (input as string) & "*/"

end run

  • name it e.g. XCode_block_comment
  • The script is saved under ~/Library/Services
  • Under Xcode >> Services >> Services Preferences
  • there you'll find XCode_block_comment
  • select it and assign it a shorcut
  • that should do the trick, in Xcode use the shortcut to comment a block of lines with /* */

Feb 16, 2022 7:05 AM in response to Joan_14

Joan_14 wrote:

regarding 2) yeah that somehow solves the problem, but I loose quite some resolution to solve it. Not really a solution for the font-size-problem but a workaround.

I poked around a little bit and found two things:

1) There is a setting in Xcode > Preferences > General > Navigator size and change it to Large. Yeah. It's not much.


2) In System Preferences, go to Accessibility > Display > Menu bar size and change that to Large. Then, immediately click on the "Accessibility" header in the window titlebar. DO NOT click on anything else. You will be prompted to log out to and you MUST do so. After logging back in, you might see a very slightly larger size of text in the menu bar. And then again, you might not. I can see the difference on my new computer with the notch, but I don't see any difference on my old 2017.

I really hoped that I missed something while searching for answers on the internet or in the help, but apparently these problems can not be properly solved. Using an additional script to out comment blocks with /* */ it seems to me like a little bit too much for an option that is available almost everywhere (I dare to say).

First of all, you have to consider the fact that Apple doesn't even consider those to be comment blocks anymore. They are now considered "Documentation markup". That's why the default theme shows them using a variably-spaced font.

For me Apple still had the good reputation of a software (OS, Apps) that had a well-designed GUI among other things. Not anymore.

This is a side effect of the modern world. It's quite brutal. The interface was designed by, and for, the standard human, i.e. a 25 year-old white male software engineer with a six-figure income who only uses an iPhone. If you don't fit that privileged culture, it is your responsibility to compromise.


I strongly encourage exploring the accessibility features. Sometimes they are buggy and/or only work on the latest hardware (as noted above). But some of them are also pretty useful. Among the screenshots that I see posted here in the forums, a significant portion of them have modified default settings. It is almost as if people don't like grey text on a grey background.


And to be fair, I can't completely blame those young Apple software engineers. They are just a reflection of modern culture. The whole world is different now. Most users don't even use the menu bar anymore. A good way to hide a feature is to make is accessible only from the menu bar. Many users will never find it. Most users only use default settings. Be very critical of how much time you spend providing those kinds of ancillary tweaks that only 5% of users will ever notice.

Feb 16, 2022 12:09 AM in response to etresoft

thanks etresoft for your input.


regarding 2) yeah that somehow solves the problem, but I loose quite some resolution to solve it. Not really a solution for the font-size-problem but a workaround.


I really hoped that I missed something while searching for answers on the internet or in the help, but apparently these problems can not be properly solved. Using an additional script to out comment blocks with /* */ it seems to me like a little bit too much for an option that is available almost everywhere (I dare to say).


For me Apple still had the good reputation of a software (OS, Apps) that had a well-designed GUI among other things. Not anymore.



Feb 16, 2022 8:50 AM in response to etresoft

1) even larger than then one I have is difficult to make a noticeable difference.

2) "glasses for near vision" - I meant reading glasses. I wear them, and despite of this, I still have to force my eyes to adapt to the font size of the menus , the project settings are the worse.

furthermore, I did change the font size of the navigator some time ago, but kept trying to enlarge the fonts of the menus without success.

thanks again for the inputs and effort

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

XCode - GUI options (font size) and block comment with /* */ and other editor features for C code

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.