Coder Social home page Coder Social logo

don't see control about nswindowstyles HOT 4 OPEN

lukakerr avatar lukakerr commented on May 29, 2024
don't see control

from nswindowstyles.

Comments (4)

PedroCavaleiro avatar PedroCavaleiro commented on May 29, 2024

Did you ever solved this problem? I'm currently having the same issue and I'm not finding how to fix it

from nswindowstyles.

thierryH91200 avatar thierryH91200 commented on May 29, 2024

not resolved i don't know what to do

from nswindowstyles.

DaveFlashNL avatar DaveFlashNL commented on May 29, 2024

doesn't seem like it, any element is rendered behind the window. I tried it with a button that's supposed to open a file dialog, no button visible only it's tab-selector border, as you can see in this image:
Schermafbeelding 2020-10-02 om 22 20 41

^this is my awesome one button app. which as the name suggests is an icon tester, the file dialog, in the previous app, not based on the new window style, would let you select an icns file and it would update itself with that on the fly.... but alas, the button can be selected, but not seen nor clicked.

from nswindowstyles.

iSapozhnik avatar iSapozhnik commented on May 29, 2024

I've been checking example 5 (that is what I needed for my app) and indeed whenever I put something on the view controller's view - its not visible.

here is the code I came up with to make ViewController's content visible:

//    5
    let visualEffect = NSVisualEffectView()
    visualEffect.translatesAutoresizingMaskIntoConstraints = false
    visualEffect.blendingMode = .behindWindow
    visualEffect.state = .active
    visualEffect.material = .dark
    window?.contentView?.addSubview(visualEffect, positioned: .below, relativeTo: window?.contentView?.subviews.first)

    guard let constraints = window?.contentView else {
      return
    }
    
    visualEffect.leadingAnchor.constraint(equalTo: constraints.leadingAnchor).isActive = true
    visualEffect.trailingAnchor.constraint(equalTo: constraints.trailingAnchor).isActive = true
    visualEffect.topAnchor.constraint(equalTo: constraints.topAnchor).isActive = true
    visualEffect.bottomAnchor.constraint(equalTo: constraints.bottomAnchor).isActive = true

    window?.styleMask.remove(.titled)
    window?.isMovableByWindowBackground = true

and that's how it looks:
image

The key here is this line: window?.contentView?.addSubview(visualEffect, positioned: .below, relativeTo: window?.contentView?.subviews.first)

Hopefully that can help you guys solve you problems.

from nswindowstyles.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.