---
name: "gk_viewport"
section: "3gk"
platform: "linux"
package: "groupkit"
version: "3.2-1"
release: "Debian 1.3 (Bo)"
platforms: ["linux"]
url: "https://new.carta.tech/gk_viewport"
---

# gk\_viewport(3gk)

Attach scrollbars to a widget

## NAME

gk\_viewport - Attach scrollbars to a widget

## SYNOPSIS

- **gk\_viewport** *pathname child* ?*options*?

  ## STANDARD OPTIONS

```
background	height	takeFocus
borderWidth	highlightBackground	relief
colormap	highlightThickness	visual
cursor	highlightColor	width
```

**See the \`\`options'' manual entry for details on the standard options.**

## WIDGET-SPECIFIC OPTIONS

```
Name:	scroll
Class:	Scroll
Command-Line Switch:	-scroll
```

-

  Specifies which scrollbars are to be attached.  This option accepts a list containing one or more of left, right, top or bottom.  Only a single vertical or a single horizontal scrollbar should be specified.

```
Name:	multiUser
Class:	MultiUser
Command-Line Switch:	-multiuser
```

-

  Specifies whether or not the scrollbars are multi-user scrollbars.  If true then the are multi-user scrollbars; if false then they are not. Any Tk boolean value is valid and the default value is true.

## DESCRIPTION

This application attaches a vertical and a horizontal scrollbar to a  child widget.  Where the scrollbars are placed and which ones are displayed depends on the value of the scroll option.  The scrollbars  used by this widget are the GroupKit scrollbars,  \`\`gk\_scrollbar''.  Whether or not they are displayed as multi-user scrollbars depends on the value of the multiuser option.

The commands that control the horizontal scrolling of the widget are  defined as follows:

- 1\.

  if the child doesn't have a *xscrollcommand* then the horizontal scrolling is ignored.

- 2\.

  if the *xscrollcommand* for the child widget is **NOT** defined then default definitions are used for *xscrollcommand* for the child widget and for the *command*.

- 3\.

  if the *xscrollcommand* for the child widget is definded  then the default definitions are **NOT** used.

A similar approach is used for the vertical scrolling.

## WIDGET COMMAND

The **gk\_viewport** command creates a new Tcl command whose name is *pathName*.  This command may be used to invoke various operations on the widget.  It has the following general form:

-

  *pathName option* ?*arg arg ...*?

*Option* and the *arg*s determine the exact behavior of the command.  The following commands are possible for gk\_viewport widgets:

- *pathName* **configure** ?*option*? ?*value option value ...*?

  Query or modify the configuration options of the widget. If no *option* is specified, returns a list describing all of the available options for *pathName* (see **Tk\_ConfigureInfo** for information on the format of this list).  If *option* is specified with no *value*, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no *option* is specified).  If one or more *option-value* pairs are specified, then the command modifies the given widget option(s) to have the given value(s);  in this case the command returns an empty string. *Option* may have any of the values accepted by the **gk\_viewport** command.

- *pathName* **cget** *option*

  Returns  the  current value of the configuration option given by option.  Option may have  any  of  the  values accepted by the text command.

- *pathName* **repack**

  Cause the viewport to be repacked.

- *pathName* **xcommand**

  Return the xscrollbar command for the horizontal scrollbar.

- *pathName* **xscrollbar**

  Return the path name of the horizontal scrollbar.

- *pathName* **ycommand**

  Return the yscrollbar command for the vertical scrollbar.

- *pathName* **yscrollbar**

  Return the path name of the vertical scrollbar.

## DEFAULT BINDINGS

The only default bindings are those defined for the GroupKit\
  scrollbar, See \`\`gk\_scrollbar'' for further details..

## NOTE

This widget is built using the GroupKit class builder; see the GroupKit User Manual for more information.  Much of the code is based on code from the Wigwam package by Jim Wight.

## SEE ALSO

gk\_scrollbar(n)

## AUTHOR

Shannon Jaeger (jaeger@cpsc.ucalgary.ca) Ideas borrowed from Jim Wight, author of Wigwam
