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

hide() has no effect on UIButton if the button's container is currently hidden #631

Open
MrAnthrope opened this issue Sep 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MrAnthrope
Copy link

Describe the bug
I have a UIPanel that is serving as the container for a number of UIButton's. show() and hide() are used to make the panel visible or not visible at various points in the game. Before making the panel visible by calling show() against it, my code determines which buttons on the panel should be visible and which should be invisible. If a button that was previously visible on the panel should be invisible when the panel is next shown, the code calls hide() against the button. Eventually the code calls show() against the panel to make the panel visible again. The button against which hide() was called is NOT hidden when the button becomes visible.

Note: If I reverse the order of the steps, calling show against the UIPanel and then calling hide() against the UIButton, the button is correctly hidden. But calling hide() against the UIButton while the UIPanel is itself hidden seems to have no effect.

To Reproduce
Steps to reproduce the behaviour:

  1. Create a UIPanel
  2. Create a UIButton setting the UIPanel as the button's container
  3. Call hide() against the UIPanel
  4. Call hide() against the UIButton
  5. Call show() against the UIPanel
  6. Observe that the button is NOT hidden despite the fact that hide() was called against it.

Expected behaviour
If hide() is called against a widget, the widget should remain hidden, regardless of changes to the visibility of the widget's container. This should be true whether the container itself was visible or invisible when hide() was called against the widget.

Platform and software (please complete the following information):

  • OS: Mac (macOS Ventura 13.5.2)
  • Pygame GUI version 0.6.12
  • Pygame version: pygame-ce 2.5.1
@MrAnthrope MrAnthrope added the bug Something isn't working label Sep 1, 2024
@MrAnthrope MrAnthrope changed the title hide() has not effect on UIButton if the button's container is currently hidden hide() has no effect on UIButton if the button's container is currently hidden Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant