Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2001 13:10:20 -0400
From:      The Anarcat <anarcat@anarcat.dyndns.org>
To:        Alexander Langer <alex@big.endian.de>
Cc:        Libh <freebsd-libh@FreeBSD.ORG>
Subject:   Re: doc/hui
Message-ID:  <20011014131019.A481@shall.anarcat.dyndns.org>
In-Reply-To: <20011014134242.B79323@fump.kawo2.rwth-aachen.de>
References:  <20011013130619.C739@shall.anarcat.dyndns.org> <20011013194100.A77141@fump.kawo2.rwth-aachen.de> <20011013141605.E739@shall.anarcat.dyndns.org> <20011014134242.B79323@fump.kawo2.rwth-aachen.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--wq9mPyueHGvFACwf
Content-Type: multipart/mixed; boundary="bp/iNruPH9dso1Pn"
Content-Disposition: inline


--bp/iNruPH9dso1Pn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun Oct 14, 2001 at 01:42:42PM +0200, Alexander Langer wrote:
> Thus spake The Anarcat (anarcat@anarcat.dyndns.org):
>=20
> > > 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).
> > Ok. How is that selected?
>=20
> $<somegroupwidget> arrange "free" / "horizontal" / "vertical"
> Groupwidget is either a DialogWidget or a WindowWidget or a ContainerWidg=
et.
> GroupWidgets can contain ContainerWidgets as well.

aaaahhh.. :) Now *this* belongs to a txt file. :)

[more clarification of the layout policies]
=20
> > > So, if you want a fixed height of 2 for example, use
> > > resize "-1 2" =20
> > > (resize "width height").
> > But the fun thing is that this will make: "fixed width of 2", and
> > "height max".
>=20
> No, this makes "fixed height of 2"

Well, not here. Test it with the attached code...

> > This should be:
> >          if (to.width() <=3D -1 && to.height() <=3D -1)
> >                  return;
>=20
> Probably, though it has the same effect already now.

Yes.

> > >                 mFixedSize =3D (to.width() < 0) ? to.height() : to.wi=
dth();
> > interesting.. is this where the "switch" would take place (ie y modifies
> > x and so on)?
>=20
> Yes.  And this is used in GroupWidget::arrange()

I guessed so.

> BTW, this is the bug.

What do you mean, in arrange()?

> > Again, I do not thing so. Modifying the first param changes y:
> >     set cmd_cont [$cons_w container "container"]
>=20
> What happens before?  What do you do with $cons_w and what
> is $cons_w?

See the attached file. I'm working on the "console" now.

> >     $cmd_cont resize "3 -1"
> >     # the container is now of a given vertical size
> >     $cmd_cont resize "5 -1"
> >     # the container is now of a bigger vertical size :)
>=20
> The above check doesn't test for the correctness of the non-"-1"-value.
> It just sets the mFixedSize in any case to the value that is not -1.
> This is why you get a bigger vertical size.

Yes, but the horizontal size is still variable!

> Can I have the whole code maybe?  Look like you are using
> a vertical arrangement.

I think so.

> I should fix this, btw.   It's on my TODO now.

well I'll try to take a look too.

This is also an "API" problem in the sense that I do not feel the
behavior is precisely defined. :)

So I attach the file that "triggered" my problems. Just look at the end
of the file for the (only) resize statement.

IMO, this file should also be put in the CVS, but I do not know where.
Maybe release/include?

A.

--bp/iNruPH9dso1Pn
Content-Type: application/x-tcl
Content-Disposition: attachment; filename="console.tcl"
Content-Transfer-Encoding: quoted-printable

global cons_w=0A=0Aproc read_cmd {hui button data} {=0A=0A    global comman=
d=0A    =0A    catch [$command text] sid=0A    cons_append $sid=0A    =0A}=
=0A=0Aproc cons_append {string} {=0A    global cons_out=0A  =0A    # XXX: t=
his is probably not the (c) good way=0A    $cons_out text [format "%s%s" [$=
cons_out text] $string]=0A    if {$string !=3D "" && $string !=3D "\n"} {=
=0A        cons_append "\n"=0A    }=0A}=0A=0A# make the console openable on=
ly once=0Aproc open_console {hui} {=0A=0A    global cons_w=0A    if {[info =
vars cons_w] =3D=3D "cons_w" &&=0A        ![catch {set cons_w $cons_w}] &&=
=0A        ![H::is_null $cons_w]=0A    } {=0A        $cons_w show=0A       =
 return=0A    } else {=0A        cons_make_main_win $hui=0A    }        =0A=
=0A=0A}=0A=0A# Create the main-window and its elements=0A#=0A# do not call =
this from outside console.tcl, use open_console instead=0Aproc cons_make_ma=
in_win {hui} {=0A    global command=0A    global cons_out=0A    global cons=
_w=0A    =0A    set cons_w [$hui window cons_w "Console" "0 0" "25 20" "ver=
tical"] =0A    =0A    set cmd_cont [$cons_w container "container"]=0A    =
=0A    set command [$cmd_cont inputLine "Console Command" "" -1]=0A    $cmd=
_cont button "gobutton" "&Eval" {read_cmd ""} "default"=0A    =0A    set co=
ns_out [$cons_w textEdit "Console Output" "" FALSE]=0A    =0A    $cmd_cont =
resize "3 -1"=0A    # Finally, show the window=0A    $cons_w show=0A}
--bp/iNruPH9dso1Pn--

--wq9mPyueHGvFACwf
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjvJxvsACgkQttcWHAnWiGctlwCfWgkaie3SE0BvUg7KLXgg2JZh
q5EAni46Ntba0hBaKw+wLTjCPMxBjCyH
=9MkA
-----END PGP SIGNATURE-----

--wq9mPyueHGvFACwf--

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?20011014131019.A481>