UI with glyphs grid

Hello,

For a future plugin I’m working on I would like to add a UI with a glyph grid so that the user could select the ones she/he would like to.

I have most of the plugin done but I have no clues on how to start with it this part of the UI and I would appreciate a lot any hint on how to start with.

Thank you so much.

Is it really needed to have a grid view? Maybe use the Select Glyphs UI (the dialog that comes up when you do Cmd+F). Just asking as this might avoid the problem.

I need to have a look if I can put together something. You are working in python, right? Have you worked with .xibs in Xcode?

1 Like

Thanks for your fast response, Georg.

It is a plugin intended to be used in modular typefaces so that you would be able to choose which modules you want to apply to a character in a very visual way. I thought having a grid could be the best option but if it can be a list such as Cmd+F it’s also fine.

I have worked with .xibs in Xcode but not a lot. I’ve always build UI using the script itself. That said, since I would love to learn more about building UI with Xcode, I’m more than up for learning how to do this.

Again, thank you so much.

I was just asking but you use case is better suited with a grid, you are right.

1 Like

Great! I’ll wait for your recommendations, then.

I had build something similar in ObjectiveC a while ago. I ported it to python.

Have a look if you understand it.

1 Like

Great! I think this is enough for now and I can manage to keep working on the plugin. I’ll re-read the docs in the SDK repository to understand better how to build UI with Xcode.

Thanks, Georg!

Hi, Georg.

I’ve spent a bit of time getting to know Xcode these days and how to bridge what I’m doing there with the plugin code and before spending more time I thought it might be wiser to ask you a couple of questions regarding this.

I’m trying to understand how can I bridge IBOutlets and IBActions from the source code of the plugin to the .xib file. I see there’s the inspector on the right showing what are the available outlets but if I generate a new Text Field that I want to connect with a new IBOutlet I can’t see how to link them. Is it only possible via code or can I connect them more visually (see screenshot of SDK Filter with Dialog).

The other question is mainly out of curiosity. Besides the previous problem, designing UI with Xcode seems much more easier and I was wondering whether is it common to write scripts with UI using Xcode and .xib files.

Again, thank you so much for your help.

If you have added the actions and the outlets to the .py file, do File > Add File… and pick the python file. Then set the class of the File’s Owner to the plugin class. Then the outlets show up in the File’s Owner. The dialog is just one of the outlet targets, doesn’t has it’t own.

1 Like

Thanks, Georg! I didn’t know how to bridge the two files.

Sorry, can you explain once again how that works? I just spent an hour trying to create a referencing outlet for a newly added text label:

• Added the IBOutlet to the py file.
• Opened the .xib.
• Add files → .py file

Now, what am I supposed to drag where, to create the referencing outlet?
Thanks!

The latest version of Xcode removed the support for python source files. I though that it can circumvented by providing an .h file but that doesn’t seem to work either. So it seems that you need to make an dummy .xcodeproj that contains the .xib and a dummy class definition like this:

@interface MYClassName : NSObject

@property IBOutlet NSTextField *myTextField;

@end

MYClassName has to match the class in your python file.

2 Likes