<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 07/02/2013 06:54 AM, András Murányi
wrote:<br>
</div>
<blockquote
cite="mid:CAJtGUK5UM5rWdGXMEcBZsPRt5N5JptRF8aK=rHAZxkwc2QC7CQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Mon, Jul 1, 2013 at 10:05 PM,
Roman Haefeli <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:reduzent@gmail.com" target="_blank">reduzent@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, 2013-07-01 at 20:56 +0200, András
Murányi wrote:<br>
> I'm reformulating my question as the problem is
evolving:<br>
> do we have an object that<br>
> - Displays and holds a text value (like Symbol or
Message box),<br>
<br>
</div>
* symbolbox with width set 0 resizes dynamically<br>
* hsl, vsl, cnv, etc. can adjust size with 'size' message,
can change<br>
displayed text with 'label' message<br>
</blockquote>
<div><br>
</div>
<div>Very good idea, thanks Roman!<br>
</div>
<div>Some difficulties I'm having:<br>
</div>
<div>- I don't know how to set the label of [cnv]... is it
possible at all?<br>
</div>
<div>- (ATTN: Ivica) [hsl] seems to have the bounding box
(?) miscalculated in l2ork so it doesn't GOP when it's
less than 2-3px from the border of the parent canvas.
Checked in Vanilla, it works as expected ([hsl] can be
placed to the very border and it will GOP).<br>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> - is Graph-on-Parent,<br>
</blockquote>
</div>
</div>
</div>
</blockquote>
<br>
If you start with an auto-resizable widget or iemgui label that
takes an<br>
arbitrary string you probably don't want to combine it with a
fixed-width<br>
geometry manager (geometry unmanager?) like a GOP canvas.<br>
<br>
You'll have to resize the width of the GOP box manually,<br>
which means you have to listen for changes to the string length of
the label<br>
and _guess_ at how many pixels that translates to. If you guess
wrong (and<br>
given that different OSes do fonts differently you will guess wrong)
it will break.<br>
Every modern GUI toolkit (even tk) assumes that the developer
doesn't want to<br>
worry about these problems, or at least assume they only want to
control them<br>
at a much higher level.<br>
<br>
For some context:<br>
Pd's diagrams actually break all the time: whenever patch authors
set<br>
up objects so that the wires to/from a secondary xlet are either
straight or at<br>
45-degree angles. Those lines may not be at the same angle on
someone else's<br>
machine, because of font rendering peculiarities on the OS or
specific font settings<br>
that user has made. The breakage can actually introduce ambiguities
that aren't<br>
there on the original author's machine, but most of the time these
breakages just<br>
degrade the diagram gracefully-- you get not-quite-straight lines
that don't look<br>
as aesthetically pleasing but the patch is fully
functional/editable.<br>
<br>
If your iemgui label or symbol box on a GOP canvas goes over the
allotted pixel<br>
width of the GOP rectangle you lose functionality because the object
no longer moves<br>
with the GOP canvas. If you're making a one-off GUI for your own
purposes this<br>
may be fine, but if you're trying to make a reusable abstraction,
don't combine<br>
auto-resizing widgets with geometry-unmanagers. They don't degrade
gracefully,<br>
and the pitfalls aren't trivial to see unless you stream the patch
to three different<br>
OSes at the same time and watch the differences.<br>
<br>
-Jonathan<br>
</body>
</html>