gwidgets

toggling a group of icons in gWidgets

天大地大妈咪最大 提交于 2020-01-17 12:24:51
问题 Adapting an example I can toggle the display of an icon like this: reject <- "D:/Pictures/web/close32.png" accept <- "D:/Pictures/web/open32.png" w= gwindow() g1 <- ggroup(horizontal=TRUE, cont=w) icon <- gimage(reject,cont=g1) state <- FALSE # a global changeState <- function(h,...) { if(state) { svalue(icon) <- reject } else { svalue(icon) <- accept } state <<- !state } addHandlerClicked(icon, handler=changeState) However, I would like to get this to work with a group of icons example 3x3

how can i change the shape mouse cursor in gWidgets RGtk2?

早过忘川 提交于 2020-01-11 10:04:27
问题 In a Drawing Area of ggraphics in gWidgets changes the mouse cursor to "GDK_TCROSS",but i want the same mouse cursor of the gwindow "GDK_LEFT_PTR": library(gWidgets) library(gWidgetsRGtk2) library(RGtk2) options(guiToolkit = "RGtk2") w=gwindow("") g=ggraphics(cont=w,no_popup=T,do.rubber.banding = F) plot(x,y) c=gdkCursorNew("GDK_TOP_LEFT_ARROW") getToolkitWidget(g)$ModifyCursor(c) or gtkWidgetModifyCursor(getToolkitWidget(g),"GDK_TCROSS","GDK_LEFT_PTR") but this not works 回答1:

how can i change the shape mouse cursor in gWidgets RGtk2?

时光毁灭记忆、已成空白 提交于 2020-01-11 10:04:15
问题 In a Drawing Area of ggraphics in gWidgets changes the mouse cursor to "GDK_TCROSS",but i want the same mouse cursor of the gwindow "GDK_LEFT_PTR": library(gWidgets) library(gWidgetsRGtk2) library(RGtk2) options(guiToolkit = "RGtk2") w=gwindow("") g=ggraphics(cont=w,no_popup=T,do.rubber.banding = F) plot(x,y) c=gdkCursorNew("GDK_TOP_LEFT_ARROW") getToolkitWidget(g)$ModifyCursor(c) or gtkWidgetModifyCursor(getToolkitWidget(g),"GDK_TCROSS","GDK_LEFT_PTR") but this not works 回答1:

how can i change the shape mouse cursor in gWidgets RGtk2?

拥有回忆 提交于 2020-01-11 10:03:46
问题 In a Drawing Area of ggraphics in gWidgets changes the mouse cursor to "GDK_TCROSS",but i want the same mouse cursor of the gwindow "GDK_LEFT_PTR": library(gWidgets) library(gWidgetsRGtk2) library(RGtk2) options(guiToolkit = "RGtk2") w=gwindow("") g=ggraphics(cont=w,no_popup=T,do.rubber.banding = F) plot(x,y) c=gdkCursorNew("GDK_TOP_LEFT_ARROW") getToolkitWidget(g)$ModifyCursor(c) or gtkWidgetModifyCursor(getToolkitWidget(g),"GDK_TCROSS","GDK_LEFT_PTR") but this not works 回答1:

How to assign icons to `gnotebook()` tabs?

余生颓废 提交于 2020-01-07 05:27:12
问题 I am using gWidgets2 to create a tabbed GUI, and I would like each tab to have an associated icon (image). Consider: require(gWidgets2) w <- gwindow("notebook example", visible=T) nb <- gnotebook(container=w) gbutton("Refresh", label="Refresh", container=nb) ## note label argument gbutton("Info", label="Info", container=nb) How can I assign the refresh icon next to the label of the 1st tab? And the info icon to the 2nd tab? 回答1: Something like this can be modified to suit your needs: function

how to make reactive combobox in r using gWidgets2RGtk2

别等时光非礼了梦想. 提交于 2019-12-25 03:42:45
问题 For my GUI, i want to have 2 combo box. combobox 1 to display Departments combobox 2 to display items in the selected department from combobox1 So if the user selects "Electronics" as department in first combobox, productElectronics should be selected for 2nd comboBox else productArts should be selected. library(gWidgets2RGtk2) deptnames <- c("Arts","Electronics") productArts <- c("Beads","Crayons") productElectronics <- c("iPad","Apple Watch") a1 <-c() w <- gwindow("combobox example") gp <-

.onLoad and gWidgets R - error in package build

僤鯓⒐⒋嵵緔 提交于 2019-12-24 17:57:45
问题 I've just finished making another R tool for a colleague and have done a simple gWidgets GUI to go with it. However I'm having trouble getting it to come up on package load: The error when building the package comes straight away in the .onLoad function, as soon as gwindow is called, on my system, even the following tidbit of code causes the error when I build the package binary - let alone my full gui: .onLoad <- function(...){ MainWindow <- gwindow("My GUI Window!", visible=TRUE) } call:

.onLoad and gWidgets R - error in package build

╄→尐↘猪︶ㄣ 提交于 2019-12-24 17:57:09
问题 I've just finished making another R tool for a colleague and have done a simple gWidgets GUI to go with it. However I'm having trouble getting it to come up on package load: The error when building the package comes straight away in the .onLoad function, as soon as gwindow is called, on my system, even the following tidbit of code causes the error when I build the package binary - let alone my full gui: .onLoad <- function(...){ MainWindow <- gwindow("My GUI Window!", visible=TRUE) } call:

gWidgets: points are not appearing in second screen

a 夏天 提交于 2019-12-24 11:08:15
问题 I am using gWidgets in R. I would like two plots to appear side by side after I split the screen. I cannot figure out why no data points appear in the second screen. library(gWidgets) win <- gwindow("Graphics example") # Create a window. # You will be prompted to select a GUI toolkit. # Enter "1" for gWidgetsRGtk2 ggraphics(ps=6, container=win) split.screen(c(1,2)) # Split screen into 2 halves screen(1) plot(c(1:10), rnorm(10)) screen(2) plot(c(1:10), rnorm(10)) You should see that the second

gWidgets: Resize combobox to fit content

拥有回忆 提交于 2019-12-23 04:49:09
问题 I have created a GUI using gWidgets and RGtk2. A part of the GUI is a glayout with a set of gcomboboxes. These boxes are initially empty and gets populated once a file is imported. On mac with Gtk+ running through X11 the width of the comboboxes gets resized to fit the longest textstring in the combobox. On windows this doesn't happen and the comboboxes gets scrollbars to accomodate the long text strings (see pictures). I have tried turning visibility off and on to force a redraw but the size