gimage: Container for an image

Description Usage Arguments Note Examples

Description

The image shows an image file. Use ghtml with the "img" tag to show a url

Usage

1
2
3
  gimage(filename = "", dirname = "", size = NULL,
    handler = NULL, action = NULL, container = NULL, ...,
    width = NULL, height = NULL, ext.args = NULL)

Arguments

filename

an image file.

dirname

ignored.

size

A vector passed to width and height arguments.

handler

optional handler bound via addHandlerChanged

action

optional value to paramaterize handler

container

parent container

...

passed along to add call of the container. Can be used to adjust layout parameters. May also have other uses.

width

a pre-specified width (in pixels) for the widget

height

a pre-specified height (in pixels) for the widget

ext.args

A list of extra arguments to pass to the ExtJS constructor

Note

requires tempdir to be mapped to a specific url, as this is assumed by get_tempfile and get_tempfile_url

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
w <- gwindow("hello", renderTo="replaceme")
sb <- gstatusbar("Powered by gWidgetsWWW and Rook", cont=w)
g <- ggroup(cont=w, horizontal=FALSE)

f <- tempfile()
png(f)
hist(rnorm(100))
dev.off()

i <- gimage(f, container=g)
b <- gbutton("click", cont=g, handler=function(h,...) {
  f <- tempfile()
  png(f)
  hist(rnorm(100))
  dev.off()
  svalue(i) <- f
})

jverzani/gWidgetsWWW2.rapache documentation built on May 20, 2019, 5:19 a.m.