Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python + XIB: Can’t make connections with Xcode 13 #64

Open
Mark2Mark opened this issue Feb 28, 2022 · 4 comments
Open

Python + XIB: Can’t make connections with Xcode 13 #64

Mark2Mark opened this issue Feb 28, 2022 · 4 comments

Comments

@Mark2Mark
Copy link
Contributor

Mark2Mark commented Feb 28, 2022

I am quite fit with the Interface Builder and Objective-C, but I never used the IB with Python until today.

I tried to follow the steps here, but struggled a lot, because I could not access the outlets from the python file.

I had added the python file, set the File’s owner to it’s main class.
There was no way to ctrl-drag anything from or to the window.

So I ended up editing the XIB as source code and copy-paste …

<connections>
    <outlet property="fontNameLabel" destination="5LS-iz-okA" id="FTt-lA-0ki"/>
    <outlet property="window" destination="QvC-M9-y7g" id="zeT-oI-P6k"/>
</connections>

… from an Objecitve-C project and matched the destination IDs.
Then it worked. The Outlets in IB have a yellow exclam, but the outlets are accessible in the python code.

Am I too stupid, or did things change over time? Has no one ever had any issues?
Xcode 13.2.1

@schriftgestalt
Copy link
Owner

could you send me the sources that I can give it a try?

@Mark2Mark
Copy link
Contributor Author

Thank you. Preparing another one that fails to connect and will put them both here in a few moment.

@Mark2Mark
Copy link
Contributor Author

The Plugin Maker does not ask for to making a Plugin with or without Dialog, so I fetched one from the "Filter with Dialog" Template and wrapped the view inside a newly added window there.

The Problem, that one cannot drag the connections is independent from if I wrap it in a window or not. It also does not work with the view instead.

When the xib is open in the IB, I add the python file (as described) and set the File’s Owner to the main class.

Now you might not be able to drag any connections, even though you should be. That’s where I was stuck and went for my workaround described above.

I wonder if it has sth to with that I fetched the IBdialog from another template (because the Plugin Maker didn’t offer one). And if so, what’s to change.

And: what’s the proper way to create the .xib, when one starts with a Template that hasn’t one?


Here the plugin which refuses to make connections for you to try:
Stubborn.glyphsPlugin.zip

And here the one where I manually made the connections in the .xib sourcecode. The Content of that plugin is a but further, and also WIP, so don’t bother with that for now :)

Plugin With Window.glyphsPlugin.zip

@Mark2Mark
Copy link
Contributor Author

Mark2Mark commented Mar 1, 2022

Submitted an issue at the pyobjc repo. Feel free to chime in or correct my explaination there :)

Ronald answered after 30 seconds :D

@Mark2Mark Mark2Mark changed the title Python + XIB steps are hard to follow Python + XIB: Can’t make connections with Xcode 13 Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants