[Gambas-user] How can I instantiate a virtual class?

T Lee Davidson t.lee.davidson at gmail.com
Thu Sep 13 15:52:30 CEST 2018


It seems, by what you have said, that you have already solved your own problem. So, I am unclear exactly what you are asking.

I may be missing something, and therefore this may be a dumb response. But, as a test of your concept, have you tried similar to
the following?

[code]
    Dim myMenu As New Menu[]
    Dim theMenu As Menu

    For Each theMenu In Menu1.Children
        myMenu.Add(theMenu)
    Next
    For Each theMenu In myMenu
        Print theMenu.Name
    Next
[/code]


___
Lee


On 9/12/18 9:13 PM, Me wrote:
> Dumb question, I know but...
> 
> Specifically I want to get a copy of MyMenu.Children into an array of Menu[] so I can re-order it. However, 
> Menu.Children is virtual (.Menu.Children).
> (I have a request to make the order of (a particular menu) user configureable.)
> I figured that if I can get a copy of the array, I could re-order it, clear the actual menu and re-add the menus in 
> the required order.
> 
> tia
> b
> p.s. I just noticed that Menu.Children is a collection not an array, but that doen't change my problem.
> 


More information about the User mailing list