[R-gui] tcltk: help with tkmenubutton

Keith Satterley keith at wehi.EDU.AU
Wed Oct 24 02:13:48 CEST 2007


You might find James Wettenhall's TclTk Examples useful. They are at:

http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/

cheers,

Keith

========================
Keith Satterley
Bioinformatics Division
The Walter and Eliza Hall Institute of Medical Research
Parkville, Melbourne,
Victoria, Australia
=======================

Alberto Vieira Ferreira Monteiro wrote:
> [I sent this message to the R-help list, without success. Is this
> the right place to ask?]
> 
> I am struck here. What magic inchantation is required with tkmenubutton?
> 
> I am converting the examples of Perl/Tk from page...
> http://gd.tuwien.ac.at/languages/perl/Hajji-Perlkurs/part4/tkperl.html
> ... to R's tcltk.
> 
> But I don't know how to convert one line in this example:
> 
> library(tcltk) 
> 
> # create a main window 
> mw <- tktoplevel()
> 
> # a menu consists of a horizontal menubar, 
> # with associated submenus 
> 
> ##### first create the horizontal menubar 
> mb <- tkframe(mw, relief = 'raised', bd = 2)
> 
> # now put in the menubar some menubuttons 
> m_file <- tkmenubutton(mb, text = "File", underline = 0)
> 
> # pack everything from the menubar 
> tkpack(mb, side = "top", fill = "x")
> tkpack(m_file, side = "left")
> 
> #### now create the submenus 
> # the file menus 
> #
> #  HERE!!! What is the magic inchantation that I must use here?
> #
> # $m_file->command(-label => "New", -command => [\&file, "new"]);
> #
> #
> 
> Alberto Monteiro
> 
> _______________________________________________
> R-SIG-GUI mailing list
> R-SIG-GUI at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-gui



More information about the R-SIG-GUI mailing list