Documentation‎ > ‎Chooser Buttons‎ > ‎

    gnocl::fileChooserButton

    A command which creates a button for selection of single files. Clicking on the displayed button will cause the display of a filechooser dialog.

    Synopsis

    gnocl::fileChooserButton [-option value...]

    Screenshot


    Options

    -borderWidth int
    Space around the widgets contents in pixels.
    -data string (default: "")
    User defined data which can be retrieved via the cget subcommand..
    -focusClick boolean (default: 1)
    Whether the button grabs focus when it is clicked with the mouse.
    -hasFocus boolean (default: 0)
    Name of the widget, can be used to set options in an rc file.
    -heightGroup string (default: "")
    The -heightGroup option can be an arbitrary string. All widgets with the same heightGroup request the same height. If packed with the fill flag set, they will have nevertheless different heights.
    -name string (default: "")
    Name of the widget, can be used to set options in an rc file..
    -onFileSet string (default: "")
    Tcl command which is executed in the global scope when a file is selected. Before evaluation the following percent strings are substituted:

    %w   widget name
    %f    name of the file selected
    %g   glade/builder name
    -sensitive boolean (default: 1)
    Whether or not the item is sensitive to user input.
    -tooltip string  (default: "")
    Message that appear next to this widget when the mouse pointer is held over it for a short amount of time.
    -title percent-string (default: "")

           Title to put on the file chooser dialog associated with the button.
    -visible boolean (default: 1)
    Whether or not the item is visible.
    -widthGroup string (default: "")

    The -widthGroup option can be an arbitrary string. All widgets with the same widthGroup request the same width. If packed with the fill flag set, they will have nevertheless different widths.

    Description

    A widget that lets the user select a file. If the button is clicked, it will launch a filechooser dialog and then display the name of the file selected and its associated icon type.

    Commands

    id cget option

    Returns the value for the specified option. The option may have any of hte values accepted by configure.

    id class

    Returns the class of the widget, i.e. fileChooserButton

    id configure [-option value...]

    Configures the widget. Option may have any of the values accepted on creation of the widget.
    id delete
    Deletes the widget and the associated tcl command.

    Example

    #!/bin/sh
    #\
    exec tclsh "$0" "$@"

    package require Gnocl

    set box [gnocl::box -orientation vertical]

    set fileBut [gnocl::fileChooserButton \
        -borderWidth 10 \
        -widthChars 15 \
        -onFileSet {puts "You picked %f"}]

    $box add $fileBut

    gnocl::window -child $box


    Comments

    Sections