Re: [Rd] Qt device update

From: Prof Brian Ripley <>
Date: Fri, 04 May 2007 22:09:58 +0100 (BST)

On Fri, 4 May 2007, Simon Urbanek wrote:

> On May 3, 2007, at 8:52 PM, Deepayan Sarkar wrote:
>> [...] I have a couple of related questions. First, dev.interactive
>> (), used in example() and many demo()-s to decide if the current
>> device is interactive, is currently implemented as:
>>> dev.interactive
>> function (orNone = FALSE)
>> {
>> iDevs <- c("X11", "GTK", "gnome", "quartz", "windows", "JavaGD")
>> interactive() && (.Device %in% iDevs || (orNone && .Device ==
>> "null device" && getOption("device") %in% iDevs))
>> }
>> This makes it impossible for new devices to be treated as interactive.
> I think we should finally pass this question to the device itself.
> For some devices like Cairo the answer depends on the parameters with
> which the device was created (e.g. type='x11' is interactive whereas
> type='png' is not), so each instance of the device will answer
> differently. We could simply add an another capability flag - that is
> IMHO the only reliable solution. Any other ideas?

Do we need a reliable solution? The worst that happens that if R thinks a device is interactive and it is not, you get asked to go on to the next page a few times.

I've altered R-devel to look at the displaylist. All the devices I knew had that enabled by default iff they are screen devices, but I've just looked at Cairo and it seems that could be a bit less dumb about its setting.

You can't in general ask the device, as there might be no device open and you need to know what the device that would automatically opened will do. And you don't want to open it, as it might not be needed. Allowing devices to say by name that they will be interactive is the only way anyone has come up with on this so far.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
Received on Fri 04 May 2007 - 21:12:28 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 05 May 2007 - 14:33:58 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.