gnustep / apps-gorm

Gorm is a clone of the Cocoa (OpenStep/NeXTSTEP) `Interface Builder' application for GNUstep
http://www.gnustep.org/
GNU General Public License v3.0
69 stars 20 forks source link

Font system menu is not connected to NSFontManager #8

Closed onflapp closed 3 years ago

onflapp commented 4 years ago

NSFontManager needs to have access to system's Font menu so that it can manage menu items based on current selection (e.g. setting "bold" or "unbold") This can be either be done by letting NSFontManager to create system Font menu or be assigning Fonts menu to NSFontManager programmatically.

When NSFontManager and Font menu are both created by Gorm, there is no way how one can connect the Fonts menu to the NSFontManager. NSFontManager shows "menu" as outlet but as it is impossible to select NSMenu itself (only NSMenuItem can be selected), the connection cannot be done manually.

Alternative approach could be to simply find Font system menu at runtime and assign it to NSFontManager (I believe that's what NextStep and Mac OS does).

gcasa commented 3 years ago

1) Start Gorm 2) Create a new Application 3) Go to the menu palette 4) Drag the Font menu into the menu 5) go to the inspector, select Connections 6) Open the Font menu, click on each menu item to see the connection

RESULT: You should see everything connected to (NSFont) the font manager.

What are you referring to? All of these items are connected to the Font Manager. Are you talking about connections FROM the font manager to the menus?

gcasa commented 3 years ago

Also, you can connect NSFont to the menu. I believe GNUstep might do this automatically when the model is loaded, but I am not sure. I will double-check.

onflapp commented 3 years ago

[NSFontManager fontMenu] is not connected to the font menu. This means that NSFontManager is not able to change menu actions (e.g. bold) based on current selection.

gcasa commented 3 years ago

This should now be fixed... PLEASE test and let me know. Re-open this issue if it doesn't work.

onflapp commented 3 years ago

@gcasa unfortunately it doesn't seem to work for me. Should the connection happen at runtime (Gorm file is loaded) or should this happen only once when I add the Font menu?

gcasa commented 3 years ago

My fix was so that when you drag the font menu in it makes the connection automatically. This will not effect existing gorm files. You need to make this connection manually for any preexisting files. My apologies for my late reply.