-
Notifications
You must be signed in to change notification settings - Fork 12
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
plugin finds wrong wx Frame #5
Comments
Possible solution:
Haven't we discussed about this while we made changes for 5.99? Anyway, I'll try to make this work. |
OK, combining algorithm from the 5.99 version with w.GetName() works:
(The old code is still there.) ID_V_TOOLBAR is used in other windows, too, and apparently wx returns the first one in the list. |
Thanks for finding this one. Can you write down which OS are you running. Yeah, the old code was brittle as pcbnew or pcb editor frame name kept changing. and there were some issues on macOc. So I thought I was smart to refactor this to find the frame by looking up the parent of vertical toolbar. It looks like, I'll have to refactor it again. But I want to find out a cross platform solution, so it might take a while |
I'm on Linux now but I can test on Windows if needed. However, I don't think there's need to test further. I just grepped "PcbFrame" in the KiCad source and found out that
so there seems to be even simpler solution which is already used within KiCad. 😄 |
wx.FindWindowByName( "PcbFrame" ) works on Windows. I didn't actually test it on Linux yet, I have no aceess to my Linux machine ATM. |
Thanks for the info. It works on linux (Kubuntu 20.04) also, and I hope it will work in macOs. But as I can not get the handler for PCB editor vertical toolbar reliably, I'll have to show the plugin centered on PCB editor window. |
When the plugin is run the next time, even when there's something to replicate and a footprint selected, the plugin main window raises eeschema.
I added logging after
logger.info("Frame repr: " + repr(self.frame))
in action_replicate_layout.py -> Run().logger.info("Frame: " + self.frame.GetTitle())
The result:
02-03 23:37:33 com_github_MitjaNemec_ReplicateLayout.action_replicate_layout 304:Frame: replicate_layout_test_project [replicate_layout_test_project/] — Schematic Editor
The text was updated successfully, but these errors were encountered: