File: gimage.Rd

package info (click to toggle)
r-cran-gwidgets 0.0-54.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 2,360 kB
  • sloc: sh: 13; makefile: 2
file content (76 lines) | stat: -rw-r--r-- 2,583 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
\name{gimage}
\alias{gimage}
\title{Constructor to show images}
\description{
  This constructor produces a widget intended to show images
  stored as files on the file system. 
}
\usage{
gimage(filename = "", dirname = "",  size = "", 
    handler = NULL, action = NULL, container = NULL, ..., 
    toolkit = guiToolkit()) 
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{filename}{Specifies location of image. May be a stock icon
  name or filename. (In the future may be a url.)}
  \item{dirname}{Directory of file. If "stock", then a stock icon is used.}
  \item{size}{Size of image when stock image is used. Values are in
    \code{c("menu", "small_toolbar","large_toolbar","button","dialog")}}
  \item{handler}{Handler called on a click event}
  \item{action}{ Passed to handler }
  \item{container}{Optional container to attach widget to.}
%  \item{obj}{a \code{glabel} instance}
%  \item{angle}{Angle to rotate label, in degrees}
  \item{\dots}{Passed to \code{add} method of container}
    \item{toolkit}{Which GUI toolkit to use}

}
\details{
  
	The \code{svalue()} method returns the filename of the figure or
	the stock icon name, if the icon was set from a stock icon.
	
	
	The \code{svalue<-()} method can be used to set the value of
	the widget. The value is a filename containing the image to
	display.

	The \code{addhandlerclicked} method is called on click
	events. 

}
% \value{}
% \references{}
% \author{}
% \note{}
\seealso{See \code{\link{getStockIcons}} to get a list of available
  icons and \code{\link{addStockIcons}} to add to this list.}
\examples{
\dontrun{
   w <- gwindow("Stock icon example")
   gimage("ok",dirname="stock", container = w)

   ## example contributed by Richard Cotton

w <- gwindow("Help button window")
add_help_button <- function(help_text, container = w,
                            width = getOption("width"), indent = 2, ...) {
  gimage("help",	      
         dirname   = "stock",
         container = container,
         handler   = function(h, ...) {
           help_win <- gwindow("Help")
           help_label <- glabel(text= strwrap(help_text, width = width, indent = indent),
                                container = help_win)
         })
}

add_help_button(paste("Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
                      "Nunc magna magna, vestibulum sit amet posuere sit amet, ",
		      "gravida placerat odio.",
                      "Integer et purus lorem, quis suscipit risus.", collapse=" "))

}
}
\keyword{ interface }% at least one, from doc/KEYWORDS