addStockIcons {gWidgets2}R Documentation

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, ...)

## Default S3 method:
.addStockIcons(toolkit, iconNames, iconFiles, ...)

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

.getStockIcons(toolkit, ...)

## Default S3 method:
.getStockIcons(toolkit, ...)

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

.getStockIconByName(toolkit, name, ...)

## Default S3 method:
.getStockIconByName(toolkit, name, file = TRUE, ...)

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

.stockIconFromClass(toolkit, theClass, ...)

## Default S3 method:
.stockIconFromClass(toolkit, theClass, ...)

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

.stockIconFromObject(toolkit, obj, ...)

## Default S3 method:
.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

## 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)

## End(Not run)

[Package gWidgets2 version 1.0-9 Index]