guiUtils {rNMR}R Documentation

rNMR Tk GUI utilities


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


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



character string; name of the desired GUI.


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


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


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


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.


list; Tk list variables to be reset.


list; Tk listboxes to be reset.


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


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


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



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.


Destroys the specified Tk GUI if open.


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.


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.


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.


Ian A. Lewis, Seth C. Schommer

See Also

toolkit for other rNMR utility functions.

[Package rNMR version 1.1.9 Index]