Git Product home page Git Product logo

garden.filebrowser's Introduction

See http://kivy-garden.github.io/garden.filebrowser/index.html

FileBrowser

The :class:FileBrowser widget is an advanced file browser. You use it similarly to FileChooser usage.

It provides a shortcut bar with links to special and system directories. When touching next to a shortcut in the links bar, it'll expand and show all the directories within that directory. It also facilitates specifying custom paths to be added to the shortcuts list.

It provides a icon and list view to choose files from. And it also accepts filter and filename inputs.

To create a FileBrowser which prints the currently selected file as well as the current text in the filename field when 'Select' is pressed, with a shortcut to the Documents directory added to the favorites bar::

ffrom kivy.app import App
from os.path import sep, expanduser, isdir, dirname

class TestApp(App):

    def build(self):
        if platform == 'win':
            user_path = dirname(expanduser('~')) + sep + 'Documents'
        else:
            user_path = expanduser('~') + sep + 'Documents'
        browser = FileBrowser(select_string='Select',
                              favorites=[(user_path, 'Documents')])
        browser.bind(
                    on_success=self._fbrowser_success,
                    on_canceled=self._fbrowser_canceled)
        return browser

    def _fbrowser_canceled(self, instance):
        print 'cancelled, Close self.'

    def _fbrowser_success(self, instance):
        print instance.selection

TestApp().run()

:Events::

`on_canceled`:
    Fired when the `Cancel` buttons `on_release` event is called.

`on_success`:
    Fired when the `Select` buttons `on_release` event is called.

License

Same license as kivy (currently MIT License).

garden.filebrowser's People

Contributors

akshayaurora avatar aron-bordin avatar farkal avatar matham avatar vingarcia avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.