[fxruby-users] FXVerticalFrame clearing compos

Jeroen van der Zijp jeroen at fox-toolkit.org
Thu Jun 11 10:56:25 EDT 2009


On Thursday 11 June 2009, Nataraj S Narayan wrote:
> Hi
> 
> 
> How do i clear the FXTextFields of a FXVerticalFrame in one go?
> What is the structure that holds the components defined for the FXVerticalFrame?

You can find the first child of a FXComposite by calling 

	child=composite->getFirst()

and subsequent siblings with:

	child=child->getNext()

until child==NULL.

Of course, no guarantee that they're FXTextFields.  I recommend:


	textfield=dynamic_cast<FXTextField*>(child);
	if(textfield){

		...

	}

or:

	if(child->isMemberOf(&FXTextField::metaClass)){
		textfield=(FXTextField*)child;

		...

	}


If you KNOW they're FXTextFields, you can of course omit the check and
simply use static_cast<FXTextField*>(child) instead, which is definitely
faster.



		- Jeroen


More information about the fxruby-users mailing list