xforms-development
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] nesting


From: Patrick
Subject: Re: [XForms] nesting
Date: Mon, 31 Aug 2015 13:26:02 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0

On 08/31/2015 09:28 AM, Jens Thoms Toerring wrote:
Hi Patrick,

On Mon, Aug 31, 2015 at 08:22:50AM -0400, Patrick wrote:
I am fine right now with just 1 form and several groups but I was
curious as to the best way build widget "assemblies" and nest them.

Groups can't be nested but the guide refers to having multiple
forms. Is it good practice to nest forms? Is so do we really need
groups?
I'm not sure what you're up to;-) But I suspect that you
want to create some kind of widget that combines a number
of objects. There are some like that, for example the
browser, which is an object that embeds a "text box" and
two scrollbars (and the scrollbars are themselves such
"combined objects, build from a slider and two "scroll-
bar buttons"). If that's what you intend to create here
a few hints of how it's handled (otherwise skip the
next paragraph).

The FL_OBJECT structure has a field called 'spec', a void
pointer. For a new class of object you design you use that
to store a pointer to some structure of your own definition,
which holds state information for that object. And this may
very well include further objects. Of course, for a new class
of object you will have to write quite a bit of code to manage
the object. For the "child" objects you typically set call-
backs that are functions of the parent object, which then
decides what is to be done (e.g. with the browser the call-
backs of the scrollbars are set to a function in the parent
browser object, that then tells the "text box" object which
part of the text to display according to the new scrollbar
position). It may be a bit of a steep learning curve, sorry.
If you go that way please feel free to ask as many questions
as necessary - perhaps it will lead to a better documentation
of this somewhat obscure corner;-) If you want to look at some
examples here's a list of all widgets that are such "combined"
objects (from memory):

   a) browser
   b) scrollbar
   c) spinner

The code for the scrollbar and the spinner are probably
simpler to get started with.

Groups have (as you probably already have read) two purposes,
one is visual (so you can hide a set of objects at once, and
they also play a role in resizing). The other are to be able
to set which radio buttons belong together. In hindsight it
probably wasn't too good an idea to use them for such un-
related purposes, and allowing to nest them may also have
been preferable. But then XForms goes back a long time
(about 25 years) when expectations at GUIs were still
rather limited;-)

Forms nearly always have their own window and while it's
possible to nest them (see e.g. the tabfolder and form-
browser object) I consider this to be rather "hackish".
But that, of course, shouldn't keep you from experimen-
ting with that if you feel it might suit your porpose!

                         Best regards, Jens

Hi Jens!


I don't actually need to create a new class yet, I am just looking to compartmentalize code and name container widgets by topics, much the same way one could with hbox and vbox under GTK. So for example chart buttons could go with a chart and this might nest under another topic and so on.


Currently I trying to use xfroms to write a free program to help disabled children communicate but I also have interests in scientific software. I buy, refurbish and resell scientific instruments. One of the most common ones I have carried is the Aminco Bowman Series II luminance spectrometer. Looks like you work with Raman.

You look to be very accomplished and it's very comforting to see that you like xforms.

You are currently recommending GPIB2 but I think your driver may be more valuable, please promote it. GPIB2 looks to be abandoned and unloved:

https://sourceforge.net/p/linux-gpib/mailman/message/28156744/

I am quite far behind you but I would like to help with your GPIB project one day but I am quite crushed at the moment.

Have a great day-Patrick





















reply via email to

[Prev in Thread] Current Thread [Next in Thread]