<br><br><div class="gmail_quote">On Tue, Oct 5, 2010 at 11:49 AM, Hadley Wickham <span dir="ltr"><<a href="mailto:hadley@rice.edu">hadley@rice.edu</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;">
Looks good. Will you add that example to the vignette?<br>
<br></blockquote><div><br>The vignette has already been updated with the new understanding.<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;">
What do you think about moving the currently intro pdf to the wiki?<br>
<br></blockquote><div><br>That's fine with me if you know of some clean, automated way of doing it. Might be tricky keeping it in sync.<br><br>Michael<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;">
Hadley<br>
<div><div></div><div class="h5"><br>
On Tue, Oct 5, 2010 at 1:07 PM, Michael Lawrence<br>
<<a href="mailto:lawrence.michael@gene.com">lawrence.michael@gene.com</a>> wrote:<br>
> Looked a bit into the layout issues. I've found that the following script<br>
> gives a fairly desirable result. Forget about the stretch factor stuff for<br>
> now, because unless a maximum or fixed size is set for a row/column, there<br>
> is no guarantee that the row/column will not expand.<br>
><br>
> library(qtpaint)<br>
><br>
> fill_painter <- function(color) {<br>
> function(item, painter) qdrawRect(painter, 0, 0, 1, 1, fill = color)<br>
> }<br>
><br>
> layout_layer <- function(Color, ...) {<br>
> qlayer(figLayer, fill_painter(Color), limits = qrect(0, 0, 1, 1), ...)<br>
> }<br>
><br>
> scene <- qscene()<br>
> figLayer <- qlayer(scene)<br>
> layout <- figLayer$gridLayout()<br>
><br>
> titleLayer <- layout_layer("red", colSpan = 2)<br>
> yaxisLayer <- layout_layer("blue", row = 1)<br>
> plotLayer <- layout_layer("green", row = 1, col = 1)<br>
> xaxisLayer <- layout_layer("yellow", row = 2, col = 1)<br>
><br>
> ## Set the maximum widths/heights:<br>
><br>
> layout$setRowMaximumHeight(0, 50)<br>
> layout$setColumnMaximumWidth(0, 50)<br>
> layout$setRowMaximumHeight(2, 50)<br>
><br>
> ## Could use Preferred here, with stretch factor set to zero, but this<br>
> ## breaks when a layer spans multiple cells. It is hard to say if this<br>
> ## is a bug in Qt, since QGraphicsGridLayout is largely<br>
> ## undocumented. QGridLayout says a stretch-zero row/column can grow<br>
> ## when no other row/column can grow. Setting a fixed or minimum<br>
> ## width/height probably sets undue restrictions on the layout. The<br>
> ## user should be able to shrink the window down, even if it is not<br>
> ## longer possible to draw the data effectively. Thus, it's probably<br>
> ## best to set the maximum.<br>
><br>
> ## It is probably cleaner to set the dimensions directly on the layer:<br>
> ## titleLayer$setMaximumHeight(50)<br>
> ## xaxisLayer$setMaximumHeight(50)<br>
> ## yaxisLayer$setMaximumWidth(50)<br>
> ## But this currently crashes due to a (reported) bug in Smoke.<br>
><br>
> qplotView(scene)<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<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>
><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Assistant Professor / Dobelman Family Junior Chair<br>
Department of Statistics / Rice University<br>
<a href="http://had.co.nz/" target="_blank">http://had.co.nz/</a><br>
</font></blockquote></div><br>