Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Oct 2001 19:41:00 +0200
From:      Alexander Langer <alex@big.endian.de>
To:        The Anarcat <anarcat@anarcat.dyndns.org>
Cc:        Libh <freebsd-libh@FreeBSD.ORG>
Subject:   Re: doc/hui
Message-ID:  <20011013194100.A77141@fump.kawo2.rwth-aachen.de>
In-Reply-To: <20011013130619.C739@shall.anarcat.dyndns.org>; from anarcat@anarcat.dyndns.org on Sat, Oct 13, 2001 at 01:06:19PM -0400
References:  <20011013130619.C739@shall.anarcat.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake The Anarcat (anarcat@anarcat.dyndns.org):

> Now the problem is that this file mentions "boxes". There are no boxes
> in the example (hello world). It is quite confusing. :)

Yes, boxes have been removed by me about one year ago.

> hit "eval". :) I have been able to make the box little, only now. But
> it's ackward. And the call is:
>     $cmd_cont resize "3 -1"
> Now I don't know, but this is odd. If I make this "1 -1", for example
> the Y dimension shrinks. Not x!!! Why? And what does the -1 *do*
> exactly? And what are the units for these dimensions???

-1 has a special meaning if you don't you free placement (=3D=3D arranging)
of widgets.

Arranging means, it raises the sub-widgets to max. possible size,
giving all sub-widgets the same width/height (depending on
if it is arranging horizontally or vertically).

Now, if you for example want a fixed size of 2 for one widget,
but the others shall be arranged automatically (you can
still use "free" arranging and do everything manually...),
use -1.

So, if you want a fixed height of 2 for example, use
resize "-1 2" =20
(resize "width height").

If you are using "free" arrangement  (I believe you do),
using -1 should have NO effect:

void
HuiQt::Widget::resize(const QSize& to, int is_arranging =3D 0)
{
        if (to.width() =3D=3D -1 && to.height() =3D=3D -1)
                return;
        if (to.width() >=3D 0 && to.height() >=3D 0) {
                /* real resize */
                if (qwidget())
                        qwidget()->resize(to);
                setsize(to);
                return;
        }
        if ((to.width() >=3D 0 || to.height() >=3D 0) && !is_arranging) {
                ContainerWidget *cp =3D
		    dynamic_cast<ContainerWidget*>( (Hui::Widget*) parent());

                GroupWidget *gp =3D
	    	    dynamic_cast<GroupWidget*>( (Hui::Widget*) parent());

                mFixedSize =3D (to.width() < 0) ? to.height() : to.width();
                /* arrange parent again since we changed the fixed size */
                if (cp !=3D NULL)
                        cp->arrange();
                if (gp !=3D NULL)
                        gp->arrange();
        }

} // HuiQt::Widget::resize


So I don't know what's happening there, it should just do nothing.

(Note that widgets still have a default size, probably given
by Qt.  So if this is the only resize statement you are using
on this widget, it is probably using Qt's default size for
that widget, which is the reason why it shrinks X and not Y :)

Alex

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-libh" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011013194100.A77141>