[R-gui] Re: RGui windows question

Duncan Murdoch murdoch at stats.uwo.ca
Fri Aug 13 16:14:54 CEST 2004


On Thu, 12 Aug 2004 15:58:41 +0200, Erich Neuwirth
<erich.neuwirth at univie.ac.at> wrote :

>Duncan,
>next week, there will be  new release of the DCOM server and RExcel.
>Graphics is still an open issue.
>One of the possibilities would be to have R controlled by Excel render 
>the graphics and when the graphics is in its finalized, just using the 
>clipboard and import the wmf file into Excel.
>This coule be made more convenient when the right click menu in R
>graphics devices would allow to add user defined menu items with 
>commands, comparable to the winMenu functions.
>Would that be hard to add?

This would be fairly easy to do as follows.  I'd add fake user menu
names corresponding to the existing menus and you'd refer to those,
e.g.

winMenuAddItem('$GraphPopup', 'Caption', 'action')

The names I can think of off the top of my head would be

$ConsoleMain (the default location for new menu additions, but it
could also be specified, just for completeness)
$ConsolePopup
$GraphMain
$GraphPopup
$DataentryMain
$DataentryPopup

I'll have to check the code to see if we've got others that I've
forgotten.

We don't have separate popups for each instance of a graph window, so
you wouldn't be able to add local menu items to just one instance. 

>Of course, it would be even more comfortable if the click also could 
>report the position like grid.locator in package grid does.

That would be harder.  Currently no information about the menu gets
passed to the command.  I might be able to record some information and
make it visible (so for example you'd call a function
"winPopupLocation" to find out where the last popup occurred).   

Duncan



More information about the R-SIG-GUI mailing list