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

wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_CENTRE_HORIZONTAL)" failed #12

Closed
iamfoolberg opened this issue Jan 23, 2022 · 5 comments

Comments

@iamfoolberg
Copy link

iamfoolberg commented Jan 23, 2022

Hi there, and thanks for your nice work.

But i got the "wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_CENTRE_HORIZONTAL)" failed" error, as following:

E:\RoSeMotion>python.exe app/main.py
Traceback (most recent call last):
  File "app/main.py", line 9, in <module>
    main()
  File "app/main.py", line 5, in main
    LeapGui.run()
  File "E:\RoSeMotion\app\LeapGui.py", line 460, in run
    LeapGui.parse_args()
  File "E:\RoSeMotion\app\resources\Gooey\gooey\python_bindings\gooey_decorator.py", line 83, in inner2
    return payload(*args, **kwargs)
  File "E:\RoSeMotion\app\LeapGui.py", line 420, in parse_args
    stored_args.save(parser.parse_args())
  File "E:\RoSeMotion\app\resources\Gooey\gooey\python_bindings\gooey_parser.py", line 113, in parse_args
    return self.parser.parse_args(args, namespace)
  File "E:\RoSeMotion\app\resources\Gooey\gooey\python_bindings\gooey_decorator.py", line 78, in run_gooey
    application.run(build_spec)
  File "E:\RoSeMotion\app\resources\Gooey\gooey\gui\application.py", line 15, in run
    app = build_app(build_spec)
  File "E:\RoSeMotion\app\resources\Gooey\gooey\gui\application.py", line 24, in build_app
    gapp = GooeyApplication(merge(build_spec, imagesPaths))
  File "E:\RoSeMotion\app\resources\Gooey\gooey\gui\containers\application.py", line 39, in __init__
    self.header = FrameHeader(self, buildSpec)
  File "E:\RoSeMotion\app\resources\Gooey\gooey\gui\components\header.py", line 33, in __init__
    self.layoutComponent()
  File "E:\RoSeMotion\app\resources\Gooey\gooey\gui\components\header.py", line 77, in layoutComponent
    PAD_SIZE)
wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_CENTRE_HORIZONTAL)" failed at ..\..\src\common\sizer.cpp(2176) in wxBoxSizer::DoInsert(): Horizontal alignment flags are ignored in horizontal sizers

i‘ve installed the "Leap_Motion_4.0.0.exe", python3.7.2 and pluged the leap motion device.

@seanschneeweiss
Copy link
Owner

seanschneeweiss commented Jan 24, 2022

This seems to be unrelated to Leap Motion or Python version. Looks like an error in Gooey. Which Gooey version are you using?

pip show gooey

Gooey==1.0.8

@seanschneeweiss
Copy link
Owner

seanschneeweiss commented Jan 24, 2022

You can also try Leap Motion 5.3.1 Gemini and Python 3.9
https://github.com/seanschneeweiss/RoSeMotion/tree/gemini-5.3.1/app/resources/LeapSDK/v53_python39
(this is unrelated to you issue, just a notice that you can use a newer Leap Motion version than 4.0.0)

@seanschneeweiss
Copy link
Owner

Seems to be a known issue from Gooey: chriskiehl/Gooey#549
You can try to update Gooey to 1.0.8.1 pip install gooey==1.0.8.1 or downgrade WxPython pip install wxPython==4.0.7

@iamfoolberg
Copy link
Author

iamfoolberg commented Jan 25, 2022

pip install gooey==1.0.8.1 does not work,
pip install wxPython==4.0.7 makes the app running, however, when i start to record, the error dialog is:

++++++++++++++++++++++++++++++++++++++++++++++
[Window Title]
Execution finished

[Content]

Uh oh! Looks like there was a problem. 
Copy the text from the status window to let your developer know what went wrong.


[OK]
++++++++++++++++++++++++++++++++++++++++++++++
The status is:

Traceback (most recent call last):
  File "app/main.py", line 9, in <module>
    main()
  File "app/main.py", line 5, in main
    LeapGui.run()
  File "E:\RoSeMotion\app\LeapGui.py", line 466, in run
    gui.set_windows_record()
  File "E:\RoSeMotion\app\GuiControl.py", line 24, in set_windows_record
    visualizer_dlg.maximize()
  File "E:\python372\lib\site-packages\pywinauto\application.py", line 396, in __getattribute__
    ctrls = self.__resolve_control(self.criteria)
  File "E:\python372\lib\site-packages\pywinauto\application.py", line 258, in __resolve_control
    criteria)
  File "E:\python372\lib\site-packages\pywinauto\timings.py", line 436, in wait_until_passes
    func_val = func(*args, **kwargs)
  File "E:\python372\lib\site-packages\pywinauto\application.py", line 203, in __get_ctrl
    dialog = self.backend.generic_wrapper_class(findwindows.find_element(**criteria[0]))
  File "E:\python372\lib\site-packages\pywinauto\findwindows.py", line 98, in find_element
    raise exception
pywinauto.findwindows.ElementAmbiguousError: There are 2 elements that match the criteria {'backend': 'win32', 'process': 3880}

@seanschneeweiss
Copy link
Owner

seanschneeweiss commented Jan 25, 2022

Looks like you have two instances of the Visualizer open at once? Best would be to close all of them.
But good to know, that this is something that should be fixed.

Error comes from this part:

def set_windows_record(self):
self.visualizer = Application().start(r"C:\Program Files\Leap Motion\Core Services\Visualizer.exe")
self.visualizer_dlg = self.visualizer.window()
self.recorder = Application().connect(class_name="wxWindowNR")
self.recorder_dlg = self.recorder.window()
visualizer_dlg = self.visualizer_dlg
recorder_dlg = self.recorder_dlg
# toggle off the help menu
visualizer_dlg.set_keyboard_focus().send_keystrokes("h---f")
# get maximum screen size
visualizer_dlg.maximize()

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

No branches or pull requests

2 participants