> At first glance, this should read 
>   PwidgetSomething(PCurWidget^.widget)^.meta =
> 'ENTITY'
> because widget is an untyped pointer ?
> 
> And the same for the other line ?
> 
> Michael.

Thanks Michael.  Actually widget is a typed pointer
but the problem I was trying to solve is that widget
could be one of two different types.  I think I solved
my problem with the following code, but I will need
write a test program to be sure.  It compiles so I
must be getting close.  :)

procedure TWidgetContainer.RenderWidgets();
var 
entity:PWidgetEntity;
container:PWidgetContainer;
base:PWidget;
begin
        MoveFirstWidget();
        while (PCurWidget^.next <> nil) do
        begin
                base:=PCurWidget^.widget; // cast the pointer to a
widget pointer
                if (base^.meta = 'ENTITY') then
                begin
                        PCurWidget^.widget:=PCurWidget^.widget;
                        entity:=PCurWidget^.widget;
                        entity^.Render();
                end
                else
                begin
                        container:=PCurWidget^.widget;
                        container^.Render();
                end;
                PCurWidget:=PCurWidget^.next;
                dispose(PHeadWidget);
                PHeadWidget:=PCurWidget;                
        end;
end;


Ron_W


                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

_______________________________________________
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to