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

Error when changing VCL styles. DelphiVCL 1.0.3 #57

Closed
IanC216 opened this issue Jul 12, 2023 · 11 comments
Closed

Error when changing VCL styles. DelphiVCL 1.0.3 #57

IanC216 opened this issue Jul 12, 2023 · 11 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@IanC216
Copy link

IanC216 commented Jul 12, 2023

This issue has already been raised (issue #50, on March 18th by @fansxs). I started a discussion on the same topic, and @lmbelo asked me to raise it as an issue again.

The ActivityIndicator.py demo crashes when I try to change style. The "__on_load_style_click" function crashes at line:
"valid_style, style_info = self.__sm.IsValidStyle(style_file_path)".
Python (v3.10) returns the error message "TypeError: cannot unpack non-iterable bool object".

Removing the "style_info" variable allows the line to run, but then a different error is raised at the line "self.__sm.LoadFromFile(style_file_path)" :

TypeError: Call "LoadFromFile" returned a value that could not be converted to Python
Error: Unsupported conversion from TValue to Python value

Here is my version of the code:
image

@IanC216
Copy link
Author

IanC216 commented Jul 13, 2023

@lmbelo Some more information that might be useful to you. When I run activityindicator.py from the console rather than in PyCharm, I get a different error. This appears immediately after choosing a valid folder from the 'Select the VCL Styles directory' dialog.
image

@Priyatham10 Priyatham10 self-assigned this Jul 14, 2023
@Priyatham10 Priyatham10 added the help wanted Extra attention is needed label Jul 14, 2023
@MGBergweiler
Copy link

MGBergweiler commented Aug 6, 2023

Using a freshly compiled pyd from the current version found in Github gives no error any more. And browsing the history of WrapVclThemes.pas gives no clue why it does not work in delphivcl.pyd 1.03.

@lmbelo
Copy link
Member

lmbelo commented Sep 6, 2023

@lmbelo Some more information that might be useful to you. When I run activityindicator.py from the console rather than in PyCharm, I get a different error. This appears immediately after choosing a valid folder from the 'Select the VCL Styles directory' dialog.
image

I believe you were seeing this issue because the console was being freed. Look for the FreeConsole method in your code.

@MGBergweiler
Copy link

MGBergweiler commented Sep 19, 2023

I must rectify my comment from 07 AUG 2023: a fresh compile of version 1.03 does not work, and also not for the new release version 1.04 (and also not directly from PIP install delphivcl)!

The source code for D4P is found in P4D, and we must note that there are three "official" repositories of P4D:

  • GetIt repository: old version 1.0, VCL styles works fine.
  • PyScripter GitHub repository: also works (last commit 02 AUG 2023).
  • Embarcaderor GitHub repository: fails (last commit 03 SEP 2023).

The source code for WrapVclThemes.pas is the same in PyScripter and Embarcadero, so I am not sure where the problem is.

@lmbelo
Copy link
Member

lmbelo commented Sep 20, 2023

@MGBergweiler I'm able to reproduce the issue. I'm working on fixing it.

@lmbelo lmbelo added the bug Something isn't working label Sep 20, 2023
@MGBergweiler
Copy link

@lmbelo I just found out that by disabling $DEFINE EXPOSE_MEMBERS, the method IsValidStyle_Wrapper now does get called, and the problem is gone.

@lmbelo
Copy link
Member

lmbelo commented Sep 20, 2023

Right! The statically wrapped method is being overridden by the dynamically exposed method.
I got this fixed. It will be available in next release.

@IanC216
Copy link
Author

IanC216 commented Sep 20, 2023 via email

@lmbelo
Copy link
Member

lmbelo commented Sep 21, 2023

@IanC216 we are planning an emergency release for the current week.

@lmbelo
Copy link
Member

lmbelo commented Sep 22, 2023

@MGBergweiler and @IanC216, there's a new version available on pypi. Can you confirm it works on this latest version, please?

@MGBergweiler
Copy link

Thanks, is working fine here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants