Skip to main content

A simple file and 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
  • Display content as symbols or in a detailed list
  • 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)

Parameters

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
  • parent: Another DirectGUI element which has pixel2d as root parent.
    The browser frame is placed centered so a frame for example should have equal sizes in horizontal and vertical directions
    e.g. frameSize=(-250,250,-200,200)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

DirectFolderBrowser-22.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

DirectFolderBrowser-22.1-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file DirectFolderBrowser-22.1.tar.gz.

File metadata

  • Download URL: DirectFolderBrowser-22.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for DirectFolderBrowser-22.1.tar.gz
Algorithm Hash digest
SHA256 0f499875d5bbcb50439c9c57f401e6811dce751c39172f95f6e10018bef304e1
MD5 40a24bad0d88c485b70e74f581a3a263
BLAKE2b-256 591c9f7d1b1dd7dcb7e815f081e7583775125f0eb5d613a16c3ee25cdab6bf18

See more details on using hashes here.

File details

Details for the file DirectFolderBrowser-22.1-py3-none-any.whl.

File metadata

  • Download URL: DirectFolderBrowser-22.1-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for DirectFolderBrowser-22.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d9e2c3521562d659aee0dbd3609c16cc09c11d6c84616a4ab24c00dbdb2e514
MD5 79383a87363fccf2da848308a958b1a1
BLAKE2b-256 c4ba617e553e258a7074751698a127490764138f1d9f73cbd889faa12b8f0722

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page