gnotebook              package:gWidgets              R Documentation

_c_o_n_s_t_r_u_c_t_o_r _f_o_r _n_o_t_e_b_o_o_k _w_i_d_g_e_t

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

     A notebook widget organizes different pages using tabs, allowing
     only one page to be shown at once. Clicking on the tab raises the
     associated page.

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

     gnotebook(tab.pos = 3, closebuttons = FALSE, dontCloseThese = NULL, container = NULL, ..., toolkit = guiToolkit())

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

 tab.pos: Where to place tabs (1 bottom, 2 left side, 3 top, 4 right
          side

closebuttons: Is there a close button in the tab?

dontCloseThese: If 'closebuttons=TRUE' this will make it impossible to
          remove these tabs. Specified by tab number

container: Optional container to attach notebook widget to 

     ...: Not utilized

 toolkit: Which GUI toolkit to use

_D_e_t_a_i_l_s:

     In what follows, it is useful to think of a notebook as a vector
     with named entries, each entry being a widget, the name being the
     tab label.

     Notebooks have the following methods:

     The 'svalue' method returns the current page number. The
     'svalue<-' method is used to set the page number.

     New pages are added with the 'add' method. The extra argument
     'label' is used to specify the tab label. This may be a string, or
     a 'glabel'. The extra argument 'index' can be used to specify
     which page to add to. By default, a new page is created at the end
     of the notebook. The extra argument 'override.closebutton' can be
     used to add or not add a close button in the tab label.

     The 'dispose' method will remove the currently selected page
     unless it is overridden by the value of 'dontCloseThese'.

     The 'delete(obj, widget,...)' method will delete the widget on a
     given page. This can then be replaced with the '[<-' method.

     The 'length' method returns the number of pages.

     The 'names' method returns the tab labels.

     The 'names<-' method may be used to replace the tab labels.
     Something like 'names(obj)[1]<-"new label"' should work.

     The '"["' method refers to the widgets in the notebook.

     The '"[<-"' method can be used to replace a widget on a notebook
     page.

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

     ## Not run: 
       nb = gnotebook(container=TRUE)
       add(nb, glabel("Widget 1"), label="page 1")
       add(nb, glabel("Widget 2"), label=glabel("page 2"))

       length(nb)
       names(nb)
       names(nb)[1] <- "Page 1"

       svalue(nb) <- 3
       dispose(nb)
       length(nb)
     ## End(Not run)

