inst/Examples/ch-RGtk2/ex-RGtk2-button-new-stock-hardway.R

### R code from vignette source 'ex-RGtk2-button-new-stock-hardway.Rnw'

###################################################
### code chunk number 1: ButtonNewFromStockHardWay
###################################################
b <- gtkButton()
g <- gtkHBox()
pbuf <- b$renderIcon("gtk-ok", size=GtkIconSize["button"]) 
i <- gtkImageNewFromPixbuf(pbuf)
i['xalign'] <- 1; i['xpad'] <- 5        # right align with padding
g$packStart(i, expand=FALSE)
l <- gtkLabel(gettext("ok")); 
l['xalign'] <- 0 # left align
g$packStart(l, expand=TRUE, fill=TRUE)
b$add(g)
## show it
w <- gtkWindow(); w$add(b)

Try the ProgGUIinR package in your browser

Any scripts or data that you put into this service are public.

ProgGUIinR documentation built on May 2, 2019, 4:04 p.m.