Skip to content

UIListBox - add option for always one item selected (use in drop down) #363

Open
@Toma400

Description

@Toma400

Describe the bug
While selecting listbox entry, their recognition works randomly, unless I un-select the entry (in such case, recognition is fully reliable).

To Reproduce
Steps to reproduce the behaviour:

  1. Create listbox and some variable to store listbox output (name of element chosen), so event.text won't be empty
  2. Create event system which overwrites variable with current event.text when entry is clicked, and with None when it is unclicked
  3. Let the program print the entry name when you click on button and variable value is not None

Expected behaviour
App should print entry name no matter how I clicked on it - be it by un-selecting, on simply switching from one entry to another.

Screenshots
Video instead:
https://user-images.githubusercontent.com/65849429/204492359-ee0edac7-80b1-4965-9c3b-867f44ef9001.mp4

Platform and software (please complete the following information):

  • OS: Windows 10
  • Pygame GUI version: 0.6.4, 0.6.5 (tested on both)
  • Pygame version [e.g. 2.0.0, 2.1.0]

Additional context
Workspace on which I worked on - L12/L27/L29 is variable system allowing me to store text passed from listbox, on L34 I try to print it when correct button is clicked and entry is selected

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions