Skip to content

Commit

Permalink
docs(examples): ensure file browser appears in front
Browse files Browse the repository at this point in the history
This is particularly an issue on Windows. Add the line that is necessary to place the dialog in
front.

Signed-off-by: Patrick Avery <[email protected]>
  • Loading branch information
psavery committed Aug 5, 2022
1 parent 3718950 commit ef1a869
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/validation/core/21_file_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@
# Keep track of the currently selected directory
state.selected_dir = "None"

root = Tk()

# Ensure the tkinter main window is hidden
Tk().withdraw()
root.withdraw()

# Ensure that the file browser will appear in front on Windows
root.wm_attributes("-topmost", 1)


def open_directory():
Expand Down

0 comments on commit ef1a869

Please sign in to comment.