356 views
in GUI Development by

What's the best way to RemoveAll() views from a Core::Group in 9.30?

 

I have the following in an UpdateViewState{} but it's retaining the views in RecMarkerGroup each time its executed.

 

var Core::Group RecMarkerGroup = new Core::Group;

RecMarkerGroup.Add(myview, 0);

 

 

1 Answer

0 votes
by

Hello Mike,

since the method RemoveAll() is not available in versions <= 9.30, you can implement following code to achieve the same effect:

// Get the first view existing within some GUI component (group)
var Core::Group group = ...; /* e.g. 'this' */
var Core::View  view  = group.FindNextView( null, Core::ViewState[]);

// Repeat as long as there are views to remove
while ( view != null )
{
  group.Remove( view );
  view = group.FindNextView( null, Core::ViewState[]);
}

See also: Enumerate and search views existing within the component.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...