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

# gk\_views(3gk)

A controller for a group graphical environment.

## NAME

gk\_views - A controller for a group graphical environment.

## SYNOPSIS

- **gk\_views** *pathName groupId*

  - **gk\_viewsGetCoords** *groupId userId*

  - **gk\_viewsSetCoords** *groupId userId coords*

  - **gk\_viewsGetAttribute** *groupId userId attribute*

  - **gk\_viewsSetAttribute** *groupId userId attribute value*

  - **gk\_viewsAttributes** *groupId userId*

  - **gk\_viewsUsers** *groupId*

  ## DESCRIPTION

This command sets-up a shared environment, for more information on environments see the gk\_newenv manual page.  The shared environment maintains user information, in particular what a particular user is  viewing in a given application as well as some other user attribute information.  An example of what might be stored in the user attribute is the user's color.  Gk\_views does not automatically initialize the coordinates nor the attributes, therefore, this must be done by the application if it is required.

The information is controlled with the various commands. The interaction between the environment and an application is two-way. The application changes and queries the environment through the various supplied commands.  In the other direction the environment  informs the application of changes  by calling particular procedures that are supplied by the application,  see the default bindings section for more information.

## COMMANDS

- **gk\_views** *pathName groupId*

  Creates the shared environment and necessary procedures.  Also sets-up the default environment bindings. This must be done before any of the other commands can be used. The *pathName* refers to the window pathName that has the expected  subcommands - adduser, deleteuser, moveuser, and changedAttribute.

  The  *groupId* is any identification that will distinguish your views  environment from any other views environment, different applications  should have  different *groupId's*  unless the information is intended to be shared  between them.

- **gk\_viewsAttributes** *groupId userId*

  Returns the list of attributes for the user.

- **gk\_viewsCopy** *pathName oldGroupId newGroupId*

  Copies all of the information stored in the old group to the new group. If the new group does not currently exist then it is created, including the default bindings.  The *pathName* refers to the window path name that has the expected subcommands.  The group identifiers, *oldGroupId* and *newGroupId*, are for the group being copied from and the group being copied to, respectively.

- **gk\_viewsDelete** *groupId ?userId?*

  Removes a user or a group users from the views environment.  If the user identification is specified then that user is the only one removed from the environment.  However, if it is not specified the entire group of user's associated with the given *groupId* are removed and the default bindings are also removed.

- **gk\_viewsGetAttribute** *groupId userId attribute*

  Returns the stored attribute information for*userId*. The format of the attribute may vary, it depends on the value given to the **gk\_viewsSetAttribute** command.   The *groupId* is the one specified in the  **gk\_views** command and the *userId* is any identification that will uniquely determine different users, typically the value used by GroupKit is used, i.e. **users local.usernum**

- **gk\_viewsGetCoords** *groupId userId*

  Returns the current location of *userId*.  The format of the returned coordinates is varied, it depends on the value given to the **gk\_viewsSetCoords** command.   The *groupId* is the one specified in the  **gk\_views** command and the *userId* is any identification that will uniquely determine different users, typically the value used by GroupKit is used, i.e. **users local.usernum**

- **gk\_viewsSetAttribute** *groupId userId attribute value*

  Sets the attribute(s) of a particular user.  The attribute may be in any  format as long as it is a single item. The *groupId* is the one  specified in the **gk\_views** command and the *userId* is any  identification that will uniquely determine different users, typically  the value used by GroupKit is used, i.e. **users local.usernum**

- **gk\_viewsSetCoords** *groupId userId coords*

  Set the coordinates of a particular user.  The coordinates may be in any format, however, they should be in a format that is useful to the particular application.  The *groupId* is the one specified in the  **gk\_views** command and the *userId* is any identification that will uniquely determine different users, typically the value used by GroupKit is used, i.e. **users local.usernum**

- **gk\_viewsUsers** *groupId*

  Returns the list of users currently in the environment, the list is sorted so it should be consistent between different users. The  *groupId* is the one specified in the **gk\_views** command.

## DEFAULT BINDINGS

The environment used allows bindings to the environment.  There are default bindings made to events that occur within an application and within the environment themselves.  Some of these binding call the widget subcommand for the window provided by to the **gk\_views** command.  The subcommand is invoked only if the event is  \`\`interesting'' to the particular widget.  An event is interesting if and only if the event contains the *groupId* that was  supplied to the **gk\_views** command.

Besides the bindings to the widget's subcommands there is one additional binding.  This one binds the given window path name to Configure to handle resizing of the window.  This bind will destroy any current bindings for Configure for the given widget.

- *pathName* **adduser** *groupId user coordinates*

  Allows the application to act on the addition of new information to the views environment.  When the **addInfo** event occurs within the  views environment it executes the procedure the subcommand **adduser** *for the window pathName supplied to the* **gk\_views** command. An error will occur if this subcommand does not exist for the widget.

- *pathName* **moveuser** *groupId user coordinates*

  Allows the application to act on a change to the *user*'s coordinates within the views environment.  When the **changeInfo** event occurs within the  views environment and a change in the coordinates has caused the event to occur this subcommand will be invoked.  An error will  occur if this subcommand does not exist for the widget.

- *pathName* **deleteuser** *groupId user*

  Allows the application take action when information is removed from the environment.  When the **deleteInfo** event occurs within the  views environment it executes this subcommand.  An error will occur if  this subcommand does not exist for the widget.

- *pathName* **changeattribute** *groupId user attribute value*

  Allows the application to act on a change to the *user*'s attribute within the views environment.  When the **changeInfo** event occurs within the  views environment and a change to the attribute has caused the event to occur this subcommand will be invoked.  An error will occur  if this subcommand does not exist for the widget.

## NOTE

There is a possibility of strange results if the *groupId* is **not** unique between gk\_views associated with different objects.

There are two elements in the environment, tags and deltag, for each user. They store environment binding tags so that they can be removed if need be.  Changes to these elments should never cause any of the subcommands  to be invoked, to the user they should appear to not exist.

## BUGS

For some unknown reason current users are not always informed about new  entrants.  This is probably  due to the fact that the environment can generate events before a conference/application knows what to do with the events.

## SEE ALSO

gk\_newenv(n) and gk\_event(n)\
 gk\_scrollbar.tcl and gk\_miniText.tcl

## AUTHOR

Shannon Jaeger (jaeger@cpsc.ucalgary.ca)
