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

Application.Run<T> is broken by not calling Init before initializing T. #3536

Closed
BDisp opened this issue Jun 13, 2024 · 0 comments
Closed

Application.Run<T> is broken by not calling Init before initializing T. #3536

BDisp opened this issue Jun 13, 2024 · 0 comments
Assignees
Labels
bug v2 For discussions, issues, etc... relavant for v2

Comments

@BDisp
Copy link
Collaborator

BDisp commented Jun 13, 2024

Describe the bug
When a Toplevel is created, it must already have all the Application configuration loaded so that it can be used by any loaded derived Toplevel. Then Application.Run<T>() must call Application.Init() before initialize the T.
This is only possible by two ways:

  1. Using Application.Init() first
  2. Using Application.Run() or Application.Run<T>()

The Application.Run(new(Toplevel)) must always call Application.Init() first because the new(Toplevel) may be a derived class that is possible using Application static properties that is only available after the Application.Init was called

To Reproduce
Steps to reproduce the behavior:

  1. Run the 'Example' project
  2. See that the ExampleWindow configuration isn't been used (ColorSheme, Application.QuitKey)

Expected behavior
The ColorSheme used should be White/Blue and Ctrl+Q

Screenshots
Actual:
image

Expected:
image

Additional context
v2_develop branch

@BDisp BDisp added bug v2 For discussions, issues, etc... relavant for v2 labels Jun 13, 2024
@BDisp BDisp self-assigned this Jun 13, 2024
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Jun 13, 2024
tig added a commit that referenced this issue Jun 14, 2024
Fixes #3536. Application.Run<T> is broken by not calling Init before initializing T.
@BDisp BDisp closed this as completed Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v2 For discussions, issues, etc... relavant for v2
Projects
None yet
Development

No branches or pull requests

1 participant