#
Prev | THIS WIDGET IMPLEMENTATION IS STILL UNDER DEVELOPMENT 08/08/08 | Next

# handleBox

## Name

handleBox -- A widget for detachable window portions.

## Synopsis

table [`-option` `value`...]

## Screenshot

## Options

-child

  type: widget-ID

  Widget ID of the child.

  NOTE: This cannot be re-configured after creation.

-handlePosition

  type: integer or one of small, normal or big (default: default)

  Position of the handle relative to the child widget.

-onAttached

  type: string (default: "")

  Tcl script which is executed if the whenever the handleBox widget is re-attached to its parent.Before evaluation the following percent strings are substituated

| %w | widget name of the parent the handlebox
| %h | widget name of the handlebox itself

-onDetached

  type: string (default: "")

  Tcl script which is executed if the whenever the handleBox widget is detached from its parent.Before evaluation the following percent strings are substituated

| %w | widget name of the parent the handlebox
| %h | widget name of the handlebox itself

-shadow

  type: ONE OF none, in, out, etchedIn or etchedOut. (default: none)
  Defines the appearance of the outline drawn around the handlebox handle.

-snapEdge

  type: ONE OF top, right , left or bottom. (default: left)
  The active edge of the detached box which must be aligned over the box root
  container in order to become re-attached.

-tooltip

  type: string
  Message that appears next to this widget when the mouse pointer is held over it for a short amount of time.

## Description

The handleBox widget is a container which can be detached from its original parent as a "float window" for relocation on other areas of the screen. The means of detaching or re-attaching the handleBox is by clicking and dragging on the widget handle. Once the widget is detached, a visible place-holder remains as the base for re-attachment. When reattaching, the active edge of the float window must be accurately placed over its original place holder. Following an attachment or detachment event, the remaining contents of the handleBox parent widget are re-packed.

## Commands

`id` class

  Returns the class type for this widget, i.e. handlebox.

`id` configure [`-option` `value`...]

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

  Note: This feature is still under development. 08/08/08

`id` delete

  Deletes the widget and the associated tcl command.

## Example

    set toolBar1 [gnocl::toolBar]
    $toolBar1 add item -text "%#Cut"
    $toolBar1 add item -text "%#Copy"
    $toolBar1 add item -text "%#Paste"
    $toolBar1 add item -text "%#Delete"

    set handleBox1 [gnocl::handleBox \
    	-shadow none \
    	-handlePosition left \
    	-snapEdge left \
    	-tooltip "tear me off" \
    	-onDetached {puts "Detached %w %h"} \
    	-onAttached {puts "Attached %w %h"} \
    	-child $toolBar1
    	]

    set toolBar2 [gnocl::toolBar]
    set ent [gnocl::entry]
    $toolBar2 add widget $ent
    $toolBar2 add item -text "%#Find"
    set handleBox2 [gnocl::handleBox \
    	-shadow none \
    	-handlePosition left \
    	-snapEdge left \
    	-tooltip "tear me off" \
    	-onDetached {puts "Detached %w %h"} \
    	-onAttached {puts "Attached %w %h"} \
    	-child $toolBar2
    	]

    set box [gnocl::box ]

    $box add $handleBox1
    $box add [gnocl::separator -orientation vertical]
    $box add $handleBox2

    gnocl::window \
    	-title "HandleBox" \
    	-child $box \
    	-onDelete { exit }

    gnocl::mainLoop

results in

## See also

box, paned, notebook, `GtkTable`, `GtkFrame`, `GtkAlignment`

Prev | Home | Next
separator | Up | button