addDrawingArea            package:iSPlot            R Documentation

_A_d_d _a _d_r_a_w_i_n_g _a_r_e_a _a_s _a _g_t_k _d_e_v_i_c_e _t_o _a _g_t_k _w_i_d_g_e_t

_D_e_s_c_r_i_p_t_i_o_n:

     addDrawingArea adds a drawing area to a gtk widget (it can be
     either  a window, a pane, a notebook, a scrolled window, or a hbox
     or vbox).   This drawing area is made into a gtk device so it can
     be plotted on  using R functions.  Two callbacks are added to the
     drawing area so it  can respond to user interaction: button press
     event and motion notify  event, but these callbacks are added in
     the function createSPlotView. Device information is stored in the
     plotView object, which is stored in viewList in the environment,
     viewEnv.

_U_s_a_g_e:

     addDrawingArea(wid, dr, width, height, devVec, addType = 1, 
                    lab = "", devName = "")

_A_r_g_u_m_e_n_t_s:

     wid: the gtk widget 

      dr: the gtk drawing area 

   width: the drawing area width 

  height: the drawing area height 

  devVec: the current device vector for the gtk window that will
          contain this drawing area - it may be a vector of length zero
          if no devices have been added to this window 

 addType: an integer that can be 1, 2, 3, 4, or 5 where 1=window, 2=2nd
          pane, 3=notebook, 4=scrolled window, 5=hbox or vbox 

     lab: the label if adding to a notebook 

 devName: the device name 

_V_a_l_u_e:

     addDrawingArea returns the number of the device that was just
     created.

_A_u_t_h_o_r(_s):

     Elizabeth Whalen

_S_e_e _A_l_s_o:

     'createGtkDev'

_E_x_a_m_p_l_e_s:

       if (interactive())
       {
         w<-gtkWindow(show=FALSE)
         dr<-gtkDrawingArea()
         devVec<-addDrawingArea(w,dr,300,300,c())
         w$Show()
         # set these parameters to make sure the plot looks as expected
         par("bg"="transparent")
         par("col"="black")
         par("fg"="black")
         plot(1:10)
         # to see R's device list
         dev.list()
         # close the window and remove the device from R's device 
         # list using dev.off
       }

