pick icon indicating copy to clipboard operation
pick copied to clipboard

Breaking out of the menu that is displayed.

Open bobolobo opened this issue 5 years ago • 2 comments

Great utility "pick". Just wondering how to exit out of the menu that is displayed if the user decides that they do not want to pick anything because what they are looking for isn't being listed... like a list of USB drives. I have even tried a "try/except" block.


try:
    title = 'Please choose Drive to write logs to ' + str(removable_volumes) + ': '
    value, index = pick(values, title, indicator='=>')
except KeyboardInterrupt as error:  # On ctrl-c from keyboard, flush buffer, close file, exit. Break loop.
    print("\n\nExiting due to user action...")

Thanks, Bob

bobolobo avatar Sep 02 '20 14:09 bobolobo

It's not supported but I think you can use register_custom_handler to achieve this.

wong2 avatar Sep 02 '20 15:09 wong2

Ok thanks. I guess I could also add a menu pick at the end like "Exit no pick" or something like that. Thanks :)

bobolobo avatar Sep 02 '20 16:09 bobolobo