guiUtils {rNMR}R Documentation

rNMR Tk GUI utilities

Description

Utilities for the creation and management of Tk GUIs in rNMR.

Usage

closeGui(guiName)
getTitles(inNames, index = TRUE)
hideGui(guiName)
myToplevel(id, parent, ...)
reset(lists, boxes, prevPaths, update = 'files', dims = 'both')
showGui(guiName)
tclCheck()

Arguments

guiName

character string; name of the desired GUI.

inNames

numeric or character vector; the file names (equivalent to the output of names(fileFolder)) to retrieve user titles for.

index

logical; if TRUE, items in inList will be preceded by an index.

id

character string; pathname (ID) for the new toplevel object.

parent

optional Tk toplevel object to set as a parent window for the newly created toplevel. If provided, the dialog will appear near its parent and will bring the parent toplevel object to the front. This is particularly useful for displaying message or error dialogs in response to user interactions within rNMR GUIs.

...

Additional arguments normally passed to tktoplevel.

lists

list; Tk list variables to be reset.

boxes

list; Tk listboxes to be reset.

prevPaths

list; reference list previously used to create items in lists.

update

character vector; type of items to be reset. Must be equal in length to lists and boxes and must be listed in the same order as items in these lists. Usually 'files' or 'overlays'.

dims

character string; one of '1D', '2D', or 'both'. Used when resetting file lists.

Details

myToplevel

A replacement function for tktoplevel. This function is used to create a toplevel object with a specific ID (pathname), not only in the global environment but the TkRoot environment as well. The ID provided by the id argument will be preceded by a "." and will be assigned to the ID field for the object. This is used in conjuction with the functions detailed below to provide additional control over rNMR GUIs and to ensure that only one instance of each GUI may be open at a given time. For more information on Tk windows see .Tk.newwin.

hideGui and showGui

Hide or show the specified GUI. This function is normally used in conjunction with iterative functions to ensure the user does not interrupt the function by interacting with open Tk GUIs.

closeGui

Destroys the specified Tk GUI if open.

getTitles

Takes a list of file names and returns the user title (as it appears in fileFolder) for each. This is primarily used for displaying spectrum names in rNMR GUIs.

reset

Several rNMR GUIs contain lists corresponding to global variables, such as file lists (from fileFolder) and overlays. These global variables are often modified by the user outside of the GUIs. The reset function is called whenever a command is executed from within a GUI in order to update these lists with their sources.

tclCheck

Tries to load the TclTk package and produces an error if the package can not be loaded or the version of the package is not 8.4 or higher. Also checks if TclTk version 8.5 is available. If so, the themed widget set (ttk) is used whenever possible.

Author(s)

Ian A. Lewis ialewis@nmrfam.wisc.edu, Seth C. Schommer schommer@nmrfam.wisc.edu

See Also

toolkit for other rNMR utility functions.


[Package rNMR version 1.1.9 Index]