GetBitmapImage: Create Icon Bitmap Image

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Create a small Tk bitmap image.

Usage

1

Arguments

type

character. Icon image type, see ‘Details’

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 poBitmap tool; specify a square icon 11 pixels on each side.

Value

An image of class tclObj.

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center

See Also

tkimage.create

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
  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 <- tcltk::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, tcltk::ttkbutton(tt, width = 2, image = get(img),
                                 command = local({k <- k; function() Fun(k)})))
    tcltk::tkgrid(get(but), row = i, column = j, padx = 5, pady = 5)
    i <- k %/% d
    j <- ifelse(j < d - 1, j + 1, 0)
  }

## End(Not run)

USGS-R/RSurvey documentation built on May 9, 2019, 6:10 p.m.