Learn R Programming

RSurvey (version 0.7-4)

GetBitmapImage: Icon Bitmap Image

Description

Create a small Tk bitmap image.

Usage

GetBitmapImage(type)

Arguments

type
character; icon image type, see Details.

Value

Details

Icon image types include: left, right, up, down, top, bottom, upleft, upright, downleft, downright, next, previous, copy, paste, find, delete, view, info, plus, minus, print, and histogram. A recommended editor for bitmap design is Paul Obermeier's http://www.posoft.de/html/poBitmapMain.html{poBitmap} tool.

See Also

tkimage.create

Examples

Run this code
types <- c("left", "right", "up", "down", "top", "bottom", "upleft", "upright", 
           "downleft", "downright", "next", "previous", "copy", "paste", "find",
           "delete", "view", "info", "plus", "minus", "print", "histogram")
fun <- function(k) print(types[k])
tt <- tktoplevel(padx = 50, pady = 50)
i <- 0
j <- 0
d <- 5
for (k in seq(along = types)) {
  img <- paste("img", k, sep = ".")
  but <- paste("but", k, sep = ".")
  assign(img, GetBitmapImage(types[k]))
  assign(but, ttkbutton(tt, width = 2, image = get(img), 
                        command = local({k <- k; function() fun(k)})))
  tkgrid(get(but), row = i, column = j, padx = 5, pady = 5)
  i <- k %/% d
  j <- ifelse(j < d - 1, j + 1, 0) 
}

Run the code above in your browser using DataLab