Documentation‎ > ‎Containers‎ > ‎

    gnocl::aspectFrame

    A command which creates a frame that conserves the aspect ratio of its child widget.

    Synopsis

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

    Screenshot


    Options

    -label string (default: "")

    Text to display in the frame label.
    -obeyChild boolean (default: 1)
    If  TRUE the aspect ratio is taken from the required height and width of the child and not from specified ratio.
    -ratio float (default: 0)

    Specified aspect ratio.Only applied if -obeyChild is set to FALSE.
    -xalign float (default: 0)
    Horizontal alignment of the child widget, ranging from 0.0 (left aligned) to 1.0 (right aligned)
    -yalign float (default: 0)
    Vertical alignment of the child widget, ranging from 0.0 (top aligned) to 1.0 (bottom aligned)
    -tooltip string (default: "")

    Message that appear next to this widget when the mouse pointer is held over it for a short amount of time.
    -data  string (default: "")
    User defined data which can be retrieved via the cget subcommand.
    -onShowHelp string (default: "")
    Tcl command which is executed in the global scope if the "show-help" signal is received, which is normally the case if the user presses F1 or Ctrl-F1. Before evaluation the following percent strings are substituted:

    %w   widget name
    %h   help type: either "whatsThis" or "tooltip" 
    -cursor  string (default: "")
    User defined data which can be retrieved via the cget subcommand.
    -sensitive boolean (default: 1)
    Whether or not the item is sensitive to user input.
    -visible boolean (default: 1)
    Whether or not the item is visible.

    Description

    The gnocl::aspectFrame widget is useful when it is necessary to want pack a widget that it can resize whilst retaining its aspect ratio, e,g drawing a small preview of a larger image. As the gnocl::aspectFrame is derived from GtkFrame, it is possible to draw a label and a frame around the child. The frame will be shrunk to fit the size of the child. 

    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. statusIcon.

    id configure [-option value...]

    Configures the widget. Option may have any of the values accepted on creation of the widget.

    id notifiy [-option value...]

    Display a notification popup with message above the statusIcon.

    Options

    -appName string (default: "")

    <description to be added>

    -summary string (default: "")

    The main notifcation message presented in enboldened capitals.
    id delete
    Deletes the widget and the associated tcl command.

    Example

    #---------------
    # test-aspectFrame.tcl
    #---------------
    # William J Giddings
    # 04-Nov-2010
    #---------------

    #!/bin/sh
    # the next line restarts using tclsh \
    exec tclsh "$0" "$@"

    package require Gnocl

    set i 1

    set but3 [gnocl::button \
        -text "BUTTON-3" \
        -onClicked {
            incr i
            $af configure -label "NUMBER - $i"} ]

    set af [gnocl::aspectFrame \
        -child $but3 \
        -xalign 0.5 \
        -yalign 0.5 \
        -label "NUMBER - $i"]

    gnocl::window \
        -child $af \
        -widthRequest 320 \
        -heightRequest 200

    gnocl::mainLoop
    Comments

    Sections