<div dir="ltr"><div><div><div>I ended up going the canvas% route. To reduce the amount of screen space that had to be redrawn when updating the progress bar or changing the status text, I created my own message% and gauge% classes based on canvas%. The final arrangement was a custom panel% that stretched its children out to the full width/height as the parent. Its children were a canvas% to fill the background, and a vertical-pane% to layout the custom message and gauge classes. To change the background color, I had to tell each part to change the background color, but that could be automated with a method to walk the children to find my custom classes.<br>
<br></div>Why don't pane% and panel% honor the stretchable-width and stretchable-height properties of their children. Every other pane/panel class does. It seems like this would be a reasonable thing to do. I have two specific use cases:<br>
</div><br>1) A tab-less tabbed panel where I want to display different content pages, but size the whole area is based on the largest width and height from the children. All but one of the children was told (send child show #f). In my case, this is a page with the controls to prepare and start an operation. Once the operation is started, it flips to a status page. There is a button to stop the operation and return back to the first page.<br>
</div><br>2) I want to arrange a canvas as a background behind other objects. After playing with this, the only other things that seem to reliably work in the foreground are other canvases so I understand this would not be a typical use.<br>
<div><div><div>
<br><div><div class="gmail_extra">Setting the minimum width and height the same for all children is OK as a starting point, but if the window grows and you want that space to grow too, the children are not currently stretched out. I ended up creating a custom pane% that overrides place-children, but it seems the default implementation could do this.<br>
<br clear="all"></div><div class="gmail_extra"><div>-- David<br></div>
<br><br><div class="gmail_quote">On Fri, Aug 22, 2014 at 2:36 PM, Matthew Flatt <span dir="ltr"><<a href="mailto:mflatt@cs.utah.edu" target="_blank">mflatt@cs.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
There's currently no way to set the background color for `message%`<br>
objects, and I'd still use a `canvas%`.<br>
<div><div><br>
At Tue, 5 Aug 2014 10:47:37 -0500, David Nelson wrote:<br>
> I am working on a manufacturing system to asynchronously program and test<br>
> 16 USB devices. The main display is a grid of "slot" displays. Each slot<br>
> display currently is a group box with the slot number in big digits, a<br>
> status message in normal sized text, and a guage to display the progress.<br>
> I'd like to change the background color of the group box for each slot<br>
> depending on the status. E.g. red for a problem, green for success, yellow<br>
> - in progress, etc..<br>
><br>
> The problem is that setting a background color only seems to be possible<br>
> with a canvas%. I seem to have two options:<br>
> 1) Use a canvas for the slot and draw all of the contents.<br>
> 2) Create a subclass of panel% that can position a canvas behind the rest<br>
> of the children.<br>
><br>
> In the previous implementation option #1 was used because I needed to work<br>
> around another issue. We used a collection of BeagleBones with small LCD<br>
> displays to drive the slots, one computer per slot. I had to roll my own<br>
> classes to deal with the display physically rotated 90 degrees from normal.<br>
> (The X server did not support rotating the display.) I used a canvas<br>
> filling the top-level frame, and then my rotated-text% and progress-bar%<br>
> classes used absolute positioning and sizing. The draw operation on the<br>
> canvas filled the background, applied a rotation transformation to the dc<br>
> and then for each child it applied the appropriate translation to the<br>
> position of the child and told the child object to draw with the rotated &<br>
> translated device context.<br>
><br>
> Comments or suggestions?<br>
><br>
> -- David<br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br></div></div></div></div></div></div>