[R-gui] Editor in R and Windows focus problems

Philippe Grosjean phgrosjean at sciviews.org
Thu Apr 29 11:44:58 CEST 2004


Duncan,

I solved this problem of R windows hiding other ones like TclTk, or Java
windows in SciViews. However, it is a complex, and probably not very elegant
way to do it (basically, I use an API function that sends a message
everytime a window is created, destroyed, or changed,...  that is ANY window
from all running apps).

Since you are in the process to add such things to R Console in SDI mode, I
suggest to have access to the following variables in R Code:
- The handle of the R Console Window,
- The handle of the task and/or the process where this window is running,
- Whether buffered output is ON or OFF,
- Whether the R Console window is topmost (the new "Stay on Top" function),
- and finally (that is perhaps a more personnal request...), whether
overtype mode is ON or OFF in the command line editing of the console
window.

- I think it should be wonderful to be able to execute a given function
whenever the R Console window is put on top of other ones... since this
would interfere with the event loop, it should be sufficient to set a
variable ".OnTop" to TRUE or FALSE... and the rest could be done in a
function registered with addTaskCallback().
- Oohh yes, speaking about addTaskCallback(). I use it to refresh the object
browser in the new version of SciViews. It is wonderful... except the
function is not triggered when it returns from another event loop than the
main one, for instance, if some code triggered by a TclTk window is
executed. Do you think it should be possible to register functions the same
way for the TclTk event loop (well, I think this is not a Windows-specific
feature, right)?

Best,

Philippe Grosjean

.......................................................<?}))><....
 ) ) ) ) )
( ( ( ( (   Prof. Philippe Grosjean
\  ___   )
 \/ECO\ (   Numerical Ecology of Aquatic Systems
 /\___/  )  Mons-Hainaut University, Pentagone
/ ___  /(   8, Av. du Champ de Mars, 7000 Mons, Belgium
 /NUM\/  )
 \___/\ (   phone: + 32.65.37.34.97, fax: + 32.65.37.33.12
       \ )  email: Philippe.Grosjean at umh.ac.be
 ) ) ) ) )  SciViews project coordinator (http://www.sciviews.org)
( ( ( ( (
...................................................................

-----Original Message-----
From: r-sig-gui-bounces at stat.math.ethz.ch
[mailto:r-sig-gui-bounces at stat.math.ethz.ch]On Behalf Of Duncan Murdoch
Sent: Thursday, 29 April, 2004 04:00
To: James Wettenhall
Cc: Soren Hojsgaard; r-sig-gui at stat.math.ethz.ch
Subject: Re: [R-gui] Editor in R and Windows focus problems


On Wed, 7 Apr 2004 23:16:39 +1000 (EST), James Wettenhall
<wettenhall at wehi.edu.au> wrote:


>I'm trying to look into the GraphApp code to see if I can find
>any clues.  Maybe one ugly way would be :
>
>tktoplevel(use=GraphAppRConsoleWindowID)
>
>where that window ID would have to be made
>available from the C code in R-devel/src/gnuwin32/  ???

That would be easy to do.  If you let me know the interface that you'd
like it to have, I'll put it into r-devel for you to try out.

Let me know what result you'd like in the case where Rgui is running
in SDI mode:  do you want to get the console window handle, or
something to indicate that there's no frame window?

Duncan Murdoch

_______________________________________________
R-SIG-GUI mailing list
R-SIG-GUI at stat.math.ethz.ch
https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-gui



More information about the R-SIG-GUI mailing list