Win {svWidgets}R Documentation

Manipulate Windows

Description

R can combine various windows (native, Tk, Gtk, etc.). There could be problems when a GUI uses various kinds of windows together. For instance, it is very difficult to define a modal window that is modal for the whole application. These functions manage windows and ease their clean creation and destruction.

Usage

WinAdd(name = "win1", type = "tkWin", parent = .TkRoot, title = NULL,
    pos = NULL, bind.delete = TRUE, ...)
WinDel(window)
WinGet(window)
WinNames()

## S3 method for class 'guiWin':
print(x, ...)

Arguments

name Name for a new window
type Type of window to create. Currently, only Tk windows ("tkWin") are supported
parent Parent of this window
title Title of the window
pos Where to place the window. A string like '+XX+YY' where XX is the horizontal position in pixels, and YY is the vertical position. Using negative values place the window relative to the right or bottom side of the screen. Specifying NULL (by default) allows for automatic placement of the window.
bind.delete Do we automatically bind WinDel() to the windows delete event (strongly advised for correct housekeeping)?
... Additional options to pass to the window creator, or the print() method
window The name of a 'guiWin' object
x An object of class 'guiWin'

Details

The list of windows and pointers to their handles are stored in '.guiWins' in the 'TempEnv' environnement.

Value

WinAdd() and WinGet() return the handle to the window (invisibly for WinAdd(). WinNames() return the list of all windows registered in .guiWins. WinDel() returns invisibly TRUE if the window is found and deleted, FALSE otherwise.

Author(s)

Philippe Grosjean

See Also

tkWinAdd, MenuReadPackage

Examples

  ## Not run: 
## These cannot be run by examples() but should be OK when pasted
## into an interactive R session with the tcltk package loaded

# Creating and destroying a Tk window and inspecting the list
WinNames()
WinAdd("tt", title = "My win", pos ="-40+20")
WinNames()
tkwm.deiconify(WinGet("tt")) # Standard tcltk functions on the window
WinDel("tt")
WinNames()
  ## End(Not run)

[Package svWidgets version 0.9-40 Index]