title: Displaying qmap with gbutton event in R
body: <p>I've been stuck on this issue for a while now and I'm really hoping someone can lend a hand. What I'm trying to do seems relatively simple, but for some reason I just can't get it to work. I'm trying to link the function qmap from the ggmap package with the press of a gbutton from the gwidget2 package so that if I press a button in one window, I can initiate the production of a map in a different window. The closest I've seen to answers on here involve drawing attention to the ggraphic using the visible&lt;- command - this doesn't seem to help. If I just issue the command for the production of the map in the command prompt: </p>
  
  <p>qmap('California')</p>
  
  <p>I get the map no problem, provided I define where the graphical device is properly, but if I try to do this via event handling of the button press, I get nothing... Here is some code to help illustrate my problem.</p>
  
  <pre><code>require(gWidgets2RGtk2)
  require(gWidgetsRGtk2)
  require(gWidgets2)
  require(cairoDevice)
  require(ggmap)
  require(ggplot2)
  require(rgdal)
  require(maptools)
  
  w1 &lt;- gwindow()
  w2 &lt;- gwindow()
  
  g1 &lt;- ggroup(cont=w1)
  g2 &lt;- ggroup(cont=w2)
  
  b1 &lt;- gbutton('Click Me',cont=g2)
  
  gr1 &lt;- ggraphics(cont=g1)
  
  button_press &lt;- addhandlerchanged(b1,  handler=function(h,...) { 
      qmap('California')
      })
  </code></pre>