1

I'd like to create a variable number of widgets inside a frame, based on data imported by the user, while keeping the frame from growing the window off the screen. If the frame becomes larger than the window or its container, I want it to show a scrollbar instead of expanding any further.

Minimal example demonstrating the issue:

library(gWidgets)
library(gWidgetsRGtk2)
options("guiToolkit"="RGtk2")

win <- gwindow(height = 200)

pane <- gpanedgroup(container = win, horizontal = TRUE)
frame <- gframe("frame",container = pane,horizontal = FALSE)

for (counter in seq_len(50)) {
  gcheckbox("check", container = frame)
}

The goal is to have frame be scrollable. Adding scrolling options like the below did not help:

pane <- gpanedgroup(container = win, horizontal = TRUE, expand = FALSE)
frame <- gframe("frame",container = pane,horizontal = FALSE, use.scrollwindow=TRUE)
bright-star
  • 6,016
  • 6
  • 42
  • 81
  • 2
    Try adding a `ggroup` instance as the child of the frame. That widget has a `use.scrollwindow` option. Add it with `expand=TRUE`, as in `ggroup(use.scrollwindow=TRUE, expand=TRUE, container=gframe_instance)`. – jverzani Sep 26 '14 at 11:38

1 Answers1

1

As jverzani stated in the comments, placing the objects to scroll in a ggroup with use.scrollwindow=TRUE and expand=TRUE creates the desired behavior.

bright-star
  • 6,016
  • 6
  • 42
  • 81