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.

Add option to store tool references and use with Bind() in generated Python code

See original GitHub issue

Currently, tool references are not stored at least when generating Python code. Tool ID’s cannot be used when binding events to handlers.

self.frame_toolbar.AddTool(wx.ID_ANY, "Help", wx.Bitmap("help.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "", "")
...
self.Bind(wx.EVT_TOOL, self.onHelpClicked, id=wx.ID_ANY)

Preferred way would be to have an option to store references and use them with Bind(). This would be consistent with how menu items are handled.

self.helpTool = self.frame_toolbar.AddTool(wx.ID_ANY, "Help", wx.Bitmap("help.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, "", "")
...
self.Bind(wx.EVT_TOOL, self.onHelpClicked, id=self.helpTool.GetId())

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
DietmarSchwertbergercommented, Oct 9, 2019

Fine. I will add some test cases and then integrate it into the master branch. I will put the optional (attribute) names on my todo list, but not with high priority. (Maybe someone volunteers for this.)

0reactions
DietmarSchwertbergercommented, Aug 29, 2020

1.0.0a1 is online.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Bindings: Calling C or C++ From Python
What are Python bindings? Should you use ctypes, CFFI, or a different tool? In this step-by-step tutorial, you'll get an overview of some...
Read more >
5. The import system — Python 3.11.1 documentation
When a regular package is imported, this __init__.py file is implicitly executed, and the objects it defines are bound to names in the...
Read more >
Protocol Buffer Basics: Python - Google Developers
Here is a program which reads an AddressBook from a file, adds one new Person to it based on user input, and writes...
Read more >
Using the Python Connector - Snowflake Documentation
The example below executes a USE DATABASE command before the CREATE SCHEMA command to ensure that the schema is created in the correct...
Read more >
Python developer reference for Azure Functions
Create Python functions by using Visual Studio Code ... the following function.json tells the runtime to use the customentry() method in the ...
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