LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically add components...

Hi!

If I want to open a file, analyse it, and then add, say a number of
radiobuttons to the design. How do I do? The actual number of buttons is
only available after analysing. Please help!

/Stefan
0 Kudos
Message 1 of 4
(4,561 Views)
Bit difficult to see what you are getting at here but perhaps you could do
the opposite i.e. rather than adding buttons depending on the file data, how
about having all possible needed buttons already placed and then using
attribute nodes disable or hide those not wanted.

Richard

Stefan Eriksson wrote in message <3789B4A5.FB75A00E@home.se>...
>Hi!
>
>If I want to open a file, analyse it, and then add, say a number of
>radiobuttons to the design. How do I do? The actual number of buttons is
>only available after analysing. Please help!
>
>/Stefan
>
0 Kudos
Message 2 of 4
(4,561 Views)
Good idea!

This is the best way I see doing it. This is one of those cases where you're
going to need a lot of attribute nodes. You will need to look into Visible and
Disabled at first. If the names/positions also change for your buttons, you'll
need to with Position and Strings[4].

Rick
--

rick@csciences.com

Chesapeake Sciences Corp.
1127B Benfield Blvd Millersville, MD 21108

Tel: (410) 923-1300 x3430 Fax: (410) 923-2669
0 Kudos
Message 3 of 4
(4,561 Views)
> If I want to open a file, analyse it, and then add, say a number of
> radiobuttons to the design. How do I do? The actual number of buttons is
> only available after analysing. Please help!
>

Sometimes you can pull this off using an array of controls. An array of
Booleans can be resized with an attribute node to display a 1D strip or
a 2D grid of buttons. If you need to have different names on each button,
then you will need to make that part of the data. Make it a 1D array of
clusters containing a string and a button. The string for each button can
now be different and is set as part of the data. If the color of each button
needs to be changable, that can be done too; just make it part of the data
using a color numeric or ramp.

If you really do want thes
e to be radio buttons, then make a VI that takes
in the old and new array of Booleans. Read the old array from the terminal,
and if something needs updating, write to a local variable. Anyway, this
may or may not work for what you are trying, but it is pretty flexible.

Greg McKaskle
0 Kudos
Message 4 of 4
(4,561 Views)