A simple folder browser for Panda3D
Project description
DirectFolderBrowser
A file and folder browser for Panda3D using DirectGUI
Features
This is a simple fullscreen file and folder browser with a basic featureset. Currently implemented are:
- Browsing files and folders
- Show/Hide hidden files (using unix like leading dot)
- Create new folders
- Filter by file extension
- Resizes with window size changes
- Makes use of the Tooltip class
Install
Install the DirectFolderBrowser via pip
pip install DirectFolderBrowser
How to use
To add a browser instance to your running Panda3D application, just instantiate it like shown here:
from DirectFolderBrowser.DirectFolderBrowser import DirectFolderBrowser
# this command will be called by the browser
def callbackCommand(ok):
if ok == 1:
print("User Clicked OK")
# print the selected file
print(browser.get())
browser.hide()
# Destroy the browser if it's not needed anymore
#browser.destroy()
elif ok == 0:
print("User Clicked Cancel")
browser.hide()
browser.destroy()
# show the browser as file browser
browser = DirectFolderBrowser(callbackCommand, fileBrowser=True)
The DirectFolderBrowser accepts a few arguments.
- command: The command that will be called on closing the browser
- fileBrowser: If set to True the browser will show files, otherwise it will only show folders
- defaultPath: The initial path the browser will be set to show
- defaultFilename: The filename that will be set by default, only usefull if fileBrowser is True
- fileExtensions: A list of extensions. Only files with those extensions will be shown. Only usefull if fileBrowser is True
- tooltip: An instance of the Tooltip class to display tooltips for certain parts of the editor
- iconDir: A directory path that contains replacement images. It must contain all required images which are:
File.png
Folder.png
FolderNew.png
FolderShowHidden.png
FolderUp.png
Reload.png
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for DirectFolderBrowser-20.10.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f5149afd0023ae59c9ddb71503e81ded9dbffbda5db825f229a85ee5799985b |
|
MD5 | 5bd29da1837bd2b0b803e7346d6c9958 |
|
BLAKE2b-256 | 2d02c843c5165452482622014b5b39bd7ea0cb99e86d45b1341b2f49f4b12900 |
Close
Hashes for DirectFolderBrowser-20.10.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b076480edae2e2538a9c1725faaf9439d28d39e541b764cb24de5dc99271e867 |
|
MD5 | 7cd96193b3a2f69d298bf7b4cc61a3be |
|
BLAKE2b-256 | ec1d64c7fb027d3fc91af0486dc2192df21d288c40bdd7e8f4759b746c9de97e |