Interactive graphics

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Interactive graphics

Dear R-Devel list members
I'm facing as problem already known and linked to the use of

getGraphicsEvent(prompt = "Waiting for input",
                  onMouseDown = NULL, onMouseMove = NULL,
                  onMouseUp = NULL, onKeybd = NULL,
                  onIdle = NULL,
                  consolePrompt = prompt)
setGraphicsEventHandlers(which = dev.cur(), ...)
getGraphicsEventEnv(which = dev.cur())
setGraphicsEventEnv(which = dev.cur(), env)

The problem rises when trying to get interrupts generated by pressing
mouse buttons and, at the same time, interrupts coming from widgets. The
idea is to locate points under a spectrum and draw a baseline.
  In my code the logical sequence of operations is:
1) widgets are created to select the datafile, the spectrum to plot, and
the baseline to use;
2) The selection of the datafile and spectrum activate widget-handlers
and the spectrum is drawn in an X-Y plot;
3) then
/setGraphicsEventHandlers(which = dev.cur(), ...)/
/are used to set the graphic handler and check if the /EventEnv$which/
corresponds to the active device and get events when mouse buttons are
pressed. Observe that these instructions are located after widgets at
the end of the code (i.e. all widget with handlers are defined).

In Windows operating systems both widget-handlers and
graphic-Event-handlers are active. This allows defining the baseline
edges under the spectrum (graphic-Event-handlers), select the baseline
(widget handlers) and plot the baseline under the spectrum (widget
Unfortunately in linux (I'm using Ubuntu 18.04 LTS) the
graphic-Event-handler masks the widget handlers. This blocks the mouse
clicks on widgets preventing any selection of the baseline and of other

The locator function uses a graphic handler letting widget-handlers
active in both windows and linux operating systems. Infortunately
locator() only responds to the Left_mouse_button while I need both the
left and right buttons. The code C_locator() used to sense the mouse
button pressing is not accessible I then cannot modify it to satisfy my
Could you suggest any solution?
Is it possible to have the C_locator code to modify it?
Thanking you in advance for the attention
best regards
G. Speranza

Dr. Giorgio Speranza Senior Researcher
CMM - FBK Sommarive str. 18
38121 Trento - Italy
Phone ++39 0461 314487

_FBK vi invita a leggere il suo Piano di rientro
| FBK invites you to read its Premises Reopening Plan

Le informazioni contenute nella presente comunicazione sono di natura 
privata e come tali sono da considerarsi riservate ed indirizzate 
esclusivamente ai destinatari indicati e per le finalità strettamente 
legate al relativo contenuto. Se avete ricevuto questo messaggio per 
errore, vi preghiamo di eliminarlo e di inviare una comunicazione 
all’indirizzo e-mail del mittente.

The information transmitted is
intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you received this in
error, please contact the sender and delete the material.

        [[alternative HTML version deleted]]

[hidden email] mailing list