title: R: Rgtk2: gwidgets: gWidgetsRGtk2
body: <p>I would like to combo gWidgets(john verzani) with Rgtk2.
  This could be used by anyone as a paradigm.</p>
  
  <p>The algorithm is as follows:
  STEP 1: Construct a gwindow (or a gframe)
  STEP 2: Construct a GTK scrollable text view
  STEP 3: Convert the last one into a gwidget
  STEP 4: Add it into the gwindow (or into the gframe)</p>
  
  <p>I wonder if this is a right thinking
  while the problem I face is with the GTK scrollable text view:
  I cannot make the scrollbars work.</p>
  
  <p>The code in R is as follows:</p>
  
  <pre><code>###########################
  # load libraries
  library(RGtk2)
  library(gWidgets)
  library(gWidgetsRGtk2)
  
  # data set
  x &lt;- c(1:9)
  y &lt;- c(10:19)
  z &lt;- c(20:29)
  df &lt;- data.frame(x, y, z)
  df.co &lt;- capture.output(df)
  
  ###########################
  # STEP 1, library(gWidgets)
  # Construct a gwindow (or a gframe)
  G.Window &lt;- gwindow()
  
  ###########################
  # STEP 2, library(RGtk2)
  # Construct a GTK scrollable text view
  Gtk.Text.View &lt;- gtkTextViewNew(show = TRUE)
  
  # create a table to attach the scrollbars
  Gtk.Table.New &lt;- gtkTableNew(2, 2, show = TRUE)
  
  # construct the scrollbars
  Gtk.H &lt;- gtkHScrollbarNew()
  Gtk.V &lt;- gtkVScrollbarNew()
  
  # attach the text view and the scrollbars to the table
  gtkTableAttach(Gtk.Table.New, Gtk.Text.View, 0, 1, 0, 1)
  gtkTableAttach(Gtk.Table.New, Gtk.H, 0, 1, 1, 2)
  gtkTableAttach(Gtk.Table.New, Gtk.V, 1, 2, 0, 1)
  
  # The scrollbars are not functional, for now.
  # So I thought of constructing a viewport.
  # The problem I face is that I cannot make the scrollbars work. 
  Gtk.Viewport &lt;- gtkViewportNew()
  
  ###########################
  # STEP 3, library(gWidgetsRGtk2)
  # Convert the table into a gwidget
  G.Table.View &lt;- as.gWidgetsRGtk2(Gtk.Table.New)
  
  ###########################
  # STEP 4, library(gWidgets)
  # Add the table into the gwindow (or into the gframe)
  add(G.Window, Gtk.Table.New)
  
  # STEP 5, make the buffer management
  Gtk.Text.View.Get.Buffer &lt;- gtkTextViewGetBuffer(Gtk.Text.View)
  
  for (i in 1:length(df.co))
  {
      Gtk.Text.Buffer.Get.Bounds &lt;- gtkTextBufferGetBounds(Gtk.Text.View.Get.Buffer)
      Gtk.Text.Buffer.Insert &lt;- gtkTextBufferInsert(Gtk.Text.View.Get.Buffer, iter=Gtk.Text.Buffer.Get.Bounds$end, text=paste(df.co[i], "\n",  sep="", collapse=""), len=-1)
      }
  
  ###########################
  </code></pre>
  
  <p>I do not want to use a GTK scrollable window,
  since I want the GTK text/table widget after it is converted into a gWidget,
  to enter also into a window (gWidget). </p>
  
  <p>I also want to apologize if this is not a subject for stackoverflow. Thank you in advance</p>