Learn R Programming

gWidgets2 (version 1.0-9)

addStockIcons: Method to add icon to list of stock icons

Description

Method to add icon to list of stock icons

generic for dispath

toolkit implementation

return list of available stock icons

generic for toolkit dispatch

default

Return stock icon name, filename, icon object from its by name

generic

default implementation

Find a stock icon from the given class

generic for dispath

Default stock icon for a given class name

Find stock icon from the given object

generic for dispath

get stock icon from object by class

Usage

addStockIcons(iconNames, iconFiles, ..., toolkit = guiToolkit())

.addStockIcons(toolkit, iconNames, iconFiles, ...)

# S3 method for default .addStockIcons(toolkit, iconNames, iconFiles, ...)

getStockIcons(..., toolkit = guiToolkit())

.getStockIcons(toolkit, ...)

# S3 method for default .getStockIcons(toolkit, ...)

getStockIconByName(name, ..., toolkit = guiToolkit())

.getStockIconByName(toolkit, name, ...)

# S3 method for default .getStockIconByName(toolkit, name, file = TRUE, ...)

stockIconFromClass(theClass, ..., toolkit = guiToolkit())

.stockIconFromClass(toolkit, theClass, ...)

# S3 method for default .stockIconFromClass(toolkit, theClass, ...)

stockIconFromObject(obj, ..., toolkit = guiToolkit())

.stockIconFromObject(toolkit, obj, ...)

# S3 method for default .stockIconFromObject(toolkit, obj, ...)

Arguments

iconNames

names of icons

iconFiles

path of icons

...

ignored

toolkit

used to dispatch into toolkit if a separate implementation is made

name

of stock icon

file

logical If TRUE, return filename. If FALSE, return toolkit icon object (if possible).

theClass

name of class

obj

an R object

Value

list of icons with names the icon name and values the icon file name or icon object (as needed by the toolkit)

name of icon.

Examples

Run this code
# NOT RUN {
## we can add icon sets, say those of glyphicons.com. Steps are download files, unzip
## then point x to path, y to name. Imagine we download and current directory is
## png directory. (Won't work with tcltk by default as these are png files)
x <- Sys.glob("*.png")
path <- paste(getwd(), x, sep=.Platform$file.sep)
nm <- gsub("\\.png", "", x)
nm <- gsub("-", "_", nm)
nm <- gsub("\\+", "_plus", nm)
addStockIcons(nm, path)
# }

Run the code above in your browser using DataLab