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

nib2cib incompletely converts NSImageView instances #2971

Open
enquora opened this issue Jan 28, 2021 · 15 comments
Open

nib2cib incompletely converts NSImageView instances #2971

enquora opened this issue Jan 28, 2021 · 15 comments

Comments

@enquora
Copy link
Contributor

enquora commented Jan 28, 2021

Instances of NSImageView in Interface Builder are incompletely converted by nib2cib.
The structure of NSImageView is correctly converted but image data is not converted when an image is set statically in Interface Builder.
ImageTest.zip

@cappbot cappbot added this to the Someday milestone Jan 28, 2021
@cappbot cappbot added the #new label Jan 28, 2021
@cappbot
Copy link

cappbot commented Jan 28, 2021

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

@didierkorthoudt
Copy link
Contributor

didierkorthoudt commented Jan 28, 2021

I’ll have a look at this one as I’m currently working on image views...

@enquora
Copy link
Contributor Author

enquora commented Jan 28, 2021

Note in the logging statement in the AppDelegate - the filepath is present in the CPImage, but nothing else.
It appears the coder simply doesn't deal with possible image data.

I hadn't previously used a static image (in IB) - this was noticed by accident while isolating bindings behaviour in the attached reduction. The problem has likely existed for a long time.

This reduction also seems to highlight the problem with NSBox and resize masks - the middle one's masks should keep it entered horizontally in the window but are not doing so.

@cacaodev
Copy link
Contributor

cacaodev commented Feb 3, 2021

@enquora
Do you know if IB encodes the image in the Nib file for images views ?
Also, can you describe in what situation it would be better to have the image encoded instead of having a reference to the file, and what problem the current behavior is causing.

There is an issue opened for the CPBox resize masks : #2970

@enquora
Copy link
Contributor Author

enquora commented Feb 3, 2021

@cacaodev
I do not, in fact, know if IB encodes images for Nibs rather than providing references - more research needed.
I've been thinking about this since running into the problem - encoding a reference seems more efficient and the more likely approach. Encoding the image data each time it is used (when used multiple times) doesn't seem like a good approach.

More research and testing needed. For our specific immediate need, I'm simply loading and setting them manually. A nuisance, but it works.

@enquora
Copy link
Contributor Author

enquora commented Feb 3, 2021

@daboe01 Can you make a tag for Xcode and nib2cib issues? I'd like to start grouping them together. IB is one of our major advantages (rapid app development) and I'd like to see reliability improvements in our next release (presumably with Aristo3).

I'm in the middle of a major rollout at the moment and can't stop to fix things like this, but will come back to them once settled. wrt Xcode, its editor is now a very good option, especially if we can get an LSP server going for Objective-J to take advantage of refactoring features.

I now have a functional xclangspec for Objective-J and am improving it incrementally.
The installer will be rolled into Xcode-Capp as part of my general cleanup of it.
I've identified a likely culprit for nib2cib's random (false) failures on Big Sur and will soon file a placeholder issue for that.
nib2cib and IDE issues seem to be related, so a single tag seems appropriate.

@daboe01
Copy link
Contributor

daboe01 commented Feb 5, 2021

@enquora good idea. this can only be done by @mrcarlberg as i am not a core-dev.

@mrcarlberg
Copy link
Member

@enquora Do you want two tags, one for Xcode and one for nib2cib?

@enquora
Copy link
Contributor Author

enquora commented Feb 8, 2021

@mrcarlberg Perhaps just a single tag - 'tools' or 'toolchain'?

@daboe01
Copy link
Contributor

daboe01 commented Feb 8, 2021

@enquora we already have the tag "tools"

@daboe01
Copy link
Contributor

daboe01 commented Mar 2, 2021

-#new
+tools
+#needs-info

@cappbot
Copy link

cappbot commented Mar 2, 2021

Milestone: Someday. Labels: #needs-info, tools. What's next? Additional information should be added as a comment to this isuse.

@didierkorthoudt
Copy link
Contributor

Digging on this one but there's a problem with nib2cib that fails converting with an error code null is not an object (evaluating 'self._superview._frame'). As always, debugging nib2cib is not simple…

@didierkorthoudt
Copy link
Contributor

A fix for the here above problem in nib2cib is pushed (see #2995).

Digging on the main problem now.

@daboe01
Copy link
Contributor

daboe01 commented Aug 1, 2021

if the filepath is correctly decoded as @enquora confirmed, the only issue is that we do not automatically copy the file into the resources folder, isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants