question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Background Light toggle

See original GitHub issue

Hi,

I’m adding some custom functionality as part of a customized panel and I would like to toggle the background light in certain scenarios (via the code).

I am able to get it to dark, but not to light again thereafter. I could see that the properties of “view options” - “background color” and “background color 2” change their values. However, I could not see any changes made to the grid.

The code I’m using:

grid = om.getOrCreateContainer('grid')
viewOptions = vis.ViewOptionsItem(self.view)
viewBackgroundLightHandler = self.viewcolors.ViewBackgroundLightHandler(viewOptions, grid, app.getToolsMenuActions()['ActionToggleBackgroundLight'])
viewBackgroundLightHandler.action.trigger()

Could you please assist?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
patmarioncommented, Jul 27, 2017

Great! Yes, anything variable you can access in the Python console in Director should also be available in the globalsDict of that script.

1reaction
patmarioncommented, Jul 27, 2017

I assume that the function in your startup.py is called like startup(robotSystem, globals()). So that means that inside the function you can access the viewBackgroundLightHandler as:

viewBackgroundLightHandler = globalsDict['viewBackgroundLightHandler']

And then pass that variable in to the constructor of your panel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Moonlight4225 Wood Rustic Light Wooden Background ...
Sold By. Amazon.com ; switch type. Toggle ; material. Wood ; dimensions. 0.25 x 5.06 x 5.38 inches ; finish type. Light Oak....
Read more >
Toggle - Light Switches - Wiring Devices & Light Controls
Get free shipping on qualified Toggle Light Switches products or Buy Online Pick Up in Store today in the Electrical Department.
Read more >
Light Switch Pictures | Download Free Images on Unsplash
Download the perfect light switch pictures. Find over 100+ of the best free light switch images. ... a red background with a bunch...
Read more >
How To Toggle Between Dark and Light Mode - W3Schools
Switch between dark and light mode with CSS and JavaScript. Toggle Dark/Light Mode. Click the button to toggle ... background-color: white; color: black;...
Read more >
Light Switch White Background royalty-free images
Find Light Switch White Background stock images in HD and millions of other royalty-free stock photos, illustrations and vectors in the Shutterstock ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found