[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XForms] nesting
Jens Thoms Toerring
Re: [XForms] nesting
Wed, 2 Sep 2015 11:43:52 +0200
On Mon, Aug 31, 2015 at 09:45:12PM -0400, Patrick wrote:
> I Feel like I am wasting your valuable time with this nesting thing.
No problem at all!
> I will be okay without nesting, it's just that it is easier for me
> to think in these terms(and I probably should not).
> GTK uses a totally different method by default for placing widgets.
> When widgets are added to a vbox they are arranged top to bottom
> vertically by default. When widgets are added to an hbox they are
> added left to right by default.
Now I get it, sorry for being a bit dense;-) That's basically
what vertical and horizontal layouts are in Qt (which I know
a bit better). But I got to disappoint you: there's no nesting
in XForms! You just put the objects somewhere into their form
and that's it! Just think of them as stamps that you stick, one
after another, on a piece of paper (so the later ones appear on
top of others), and you have a rather good image of what's
going on;-) Nothing fancy at all...
And if a form is resized the objects get resized and moved
according to a method that is basically "stolen" from Xlib.
On the one hand you can set a flag that tells if an object
is to be resized in x- or y-direction at all. On the other
you can set "gravities" with which you can set if the position
of an object should be kept fixed relative some of the sides
or corners. Note that these setting for resizing and repositio-
ning aren't orthogonal, i.e. some settings can conflict (in
which case some of them are ignored) - i.e. if you've set an
object to be non-resizable in x-direction and, at the same
time, that it's left side should always keep the same distance
to the left border of the form and its right side should keep
a constant distance to the right side of the form, then these
settings obviously conflict, and the non-resizable setting is
disregarded. To get my own head wrapped around that I've writ-
ten the 'grav' demo program where you can set all these flags
for a simple box and then see what happens to it when you re-
size the window.
So it's all a concept quite different to how things are done
in more modern toolkits with their nestable layouts. I guess
that back when XForms was started no-one expected to have more
than a few objects in a window, thus things like nesting were
not considered of much interest.
> I am glad that the Linux GPIB project has worked out for you.
> It was alarming for me to hear it's main creator talk about it in
> such harsh terms though.
I was too at that time, but I guess he must have been a bit
frustrated at that time;-) And then the NI GPIB library it
mimics (I think it was supposed to be a ddirect replacement)
isn't the most pretty I've seen. And what he started from,
the "Linux Lab Project" (defunct now for at least a decade),
was neither. And then, as far as I've seen, he's moved into
deep C++ hacking (one of the Boost modules is by him), and
that rather likely made the old, crufty C code look even
worse to him (a sentiment I can sympathize a bit with;-)
> It's quite large and does many things,
> perhaps too many things like controlling GPIB devices from PHP.
Id guess that part of the size is due to the enormous number
of devices supported. And the PHP-stuff is just a wrapper on
top of it (which I've never used, not being a huge fan of PHP).
> Have you ever had a look at the source code? Do you think it is good
> quality? I haven't looked for a few years and didn't have the skills
> to form an opinion about it.
Not too often and not lately. As far as I've seen not everything
is too pretty, but then, what do you expect from something that
has "grown" over such a long time? But as long as it works... ;-)
It's a bit like with XForms - I also wouldn't consider it to
be really pretty (and I've sworn a lot from time to time;-).
But then it mostly works, and starting from scratch, just to
have a new implementation that behaves exactly as the old
one with all the warts (and backward compatibility is a major
issue!), simply doesn't make sense.
> Your work might be older but if it's smaller and cleaner maybe it is
> worth updating.
I really don't think so - it was my very first attempt at a kernel
driver and thus is of rather dubious quality. If at all, the whole
thing would have to be redone from scratch, and to get it anywhere
near to what the linux-gpib library can do would require a real lot
of effort (and then I don't have access to most of the hardware,
so how could I possibly test if anything works?).
Best regards, Jens
\ Jens Thoms Toerring ________ address@hidden
|[Prev in Thread]
||[Next in Thread]|
- Re: [XForms] nesting,
Jens Thoms Toerring <=