From @per@nz@ @end|ng |rom |bk@eu  Sun Aug  9 12:09:27 2020
From: @per@nz@ @end|ng |rom |bk@eu (speranza)
Date: Sun, 9 Aug 2020 12:09:27 +0200
Subject: [Rd] Interactive graphics
Message-ID: <1ca58d86-fea4-9407-b629-cdcc6859535a@fbk.eu>

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(), ...)/
/getGraphicsEventEnv()//
/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 
handlers).
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 
options.

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 
needs.
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 
<https://trasparenza.fbk.eu/COVID-19-comunicazioni-del-Datore-di-Lavoro-raccomandazioni-e-altro/Piano-di-rientro-FBK/Piano-di-rientro-FBK>?
| FBK invites you to read its?Premises Reopening Plan 
<https://trasparenza.fbk.eu/COVID-19-comunicazioni-del-Datore-di-Lavoro-raccomandazioni-e-altro/Piano-di-rientro-FBK/English-version_FBK-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]]



[Rd] Interactive graphics
speranza