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

XRC error: 766: unknown style flag "wxTE_CENTER" #724

Open
IamSierraCharlie opened this issue Jan 25, 2022 · 6 comments
Open

XRC error: 766: unknown style flag "wxTE_CENTER" #724

IamSierraCharlie opened this issue Jan 25, 2022 · 6 comments

Comments

@IamSierraCharlie
Copy link

IamSierraCharlie commented Jan 25, 2022

Hi, Using your wxFormBuilder (very helpful app BTW!!) application in Ubuntu Linux 20.04 and have come across this error:
image
If I go to the created .xrc file and change the spelling of "CENTER" to "CENTRE", it seems to resolve the issue.

Is this an issue for anyone else or is there something simple that I can adjust to fix this? I really prefer not to change the xrc file each time I create it. I guess it depends where live as to how you might spell CENTER/CENTRE.... I hail from Australia so the latter is the way they do it over here :-)

wxFormBuilder info
version is 3.10.1-39-g978478d5
image

wxpython build info:
4.1.1 - installed from Pip - I thought I had 4.0.4, but not the case - conda suggests its an update to 4.1.1 ???
image

many thanks for your time
Steve

@IamSierraCharlie
Copy link
Author

I did just find this as a pull request:
#449
will being on a different version of wxpython resolve this by chance?

@sodevel
Copy link
Member

sodevel commented Feb 11, 2022

What is actually causing this error message? wxFormbuilder? Your own application? When does it happen?

I am only using C++ and know almost nothing about wxPython but especially nothing about their versioning. These flags got renamed a long time ago in the C++ library and i just renamed them in wxFB too. These changes have happened in some wxWidgets 3.1.x version, i don't know what wxPython version you need to use such a wxWidgets version.

@IamSierraCharlie
Copy link
Author

I use wxFormBuilder to build my GUI for use in my Python project and the error shows up when I go to run it.
My project uses wxPython 4.1.1.

image

Its now clear to me that there is a spelling issue.
I do have a workaround - I can open the xrc file produced by wxFormBuilder and change all of the names in there "wxTE_CENTER" to "wxTE_CENTRE". wxFormBuilder is spelling it with ER and WXPython is expecting RE spelling so it complains. It doesn't completely crash my program though. I'm not sure where this issue actually falls to be honest. I guess it doesn't matter as long as they are the same. If you could let me know when this flag was actually changed - I'll query it with the folks over at the WXPython repo and get some feedback from them.
Thanks

@damufo
Copy link

damufo commented Jul 18, 2022

Hello:

wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_CENTRE_VERTICAL)" failed at /tmp/pip-install-e90bvi9c/wxpython/ext/wxWidgets/src/common/sizer.cpp(2143) in DoInsert(): Vertical alignment flags are ignored in vertical sizers

This issue occurred when upgrading from wxpython 4.07 to 4.1.1

Ideally, when saving the project, wxformbuilder should act in two ways:

  • warn of the error
  • Correct it (omitting in this case wxALIGN_CENTRE_VERTICAL) in the generated code

Very thanks!

@sodevel
Copy link
Member

sodevel commented Jul 22, 2022

First, your issue is unrelated to the OP issue. Second, these assertions are created by wxWidgets internally, there is no official specification of what does get checked. It is just too much of a burden to extract the rules from the wxWidgets sources and keep them in sync. wxFB does not validate your design at all, there are way more serious errors you can make than triggering such assertions, validation is currently out of scope and won't be implemented for now.

@damufo
Copy link

damufo commented Jul 26, 2022

OK! Very thanks.

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

3 participants