<br><br><div class="gmail_quote">On Tue, Sep 21, 2010 at 4:14 AM, Deepayan Sarkar <span dir="ltr"><<a href="mailto:deepayan.sarkar@gmail.com">deepayan.sarkar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
In my efforts to resurrect mosaiq, I have managed to put two "panel"<br>
layers on the root layer as follows:<br>
<br>
-----------<br>
<br>
library(qtpaint)<br>
<br>
scene <- qscene()<br>
root <- qlayer(scene)<br>
<br>
scatterplotLayer <-<br>
function(x = runif(10), y = runif(10),<br>
fill = "black", row, col)<br>
{<br>
force(x)<br>
force(y)<br>
paintFun <- function(item, painter, exposed)<br>
{<br>
qdrawGlyph(painter, qglyphCircle(), x, y, fill = qcolor(fill))<br>
}<br>
qlayer(root, paintFun = paintFun, cache = TRUE,<br>
limits = qrect(c(0, 1), c(0, 1)),<br>
row = row, col = col)<br>
}<br>
<br>
panel1 <- scatterplotLayer(row = 0, col = 0, fill = "red")<br>
panel2 <- scatterplotLayer(row = 1, col = 1, fill = "green")<br>
<br>
(view <- qplotView(scene = scene, opengl = FALSE))<br>
<br>
-----------<br>
<br>
However, this requires that I specify the position in the layout at<br>
the time of creating the layer. The old mosaiq created parent-less<br>
layers first and then put them in the root layer's layout. I have<br>
tried this in two ways, both have failed:<br>
<br>
-----------<br>
<br>
library(qtpaint)<br>
scene <- qscene()<br>
root <- qlayer(scene)<br>
<br>
scatterplotLayer <- function(x = runif(10), y = runif(10), fill = "black")<br>
{<br>
force(x)<br>
force(y)<br>
paintFun <- function(item, painter, exposed)<br>
{<br>
qdrawGlyph(painter, qglyphCircle(), x, y, fill = qcolor(fill))<br>
}<br>
qlayer(NULL, paintFun = paintFun, cache = TRUE,<br>
limits = qrect(c(0, 1), c(0, 1)))<br>
}<br>
<br>
panel1 <- scatterplotLayer()<br>
panel2 <- scatterplotLayer()<br>
<br>
## This gives an error: Wrong number or types of arguments passed to<br>
## 'Qanviz::RLayer::addLayer'<br>
root[0, 0] <- panel1<br>
root[1, 1] <- panel2<br>
<br></blockquote><div><br>This issue is now fixed in qtpaint svn (0.7.11).<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
## This crashes<br>
layout <- root$gridLayout()<br>
layout$addItem(panel1, 0, 0)<br>
layout$addItem(panel2, 1, 1)<br>
<br></blockquote><div><br>This crash is due to a bug in Smoke. The Smoke guy said he would fix it some weekend.<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
-----------<br>
<br>
Is there a way to achieve this? How is addLayer supposed to work?<br>
<br>
-Deepayan<br>
_______________________________________________<br>
Qtinterfaces-devel mailing list<br>
<a href="mailto:Qtinterfaces-devel@lists.r-forge.r-project.org">Qtinterfaces-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel</a><br>
</blockquote></div><br>