Chromatic <[EMAIL PROTECTED]> wrote:
> Hi there,

> What's the best way to access fields within an UnManagedStruct, one
> returned from an NCI call?  For example, if I call _new_SDL_Screen, how
> can I access the w and h fields of the SDL_Surface it returns?

> I've tried creating an OrderedHash called layout and then doing:

>       set screen, layout

Above statement just aliases both P-registers to point to the same thing,

_new_SDL_screen has a return type of 'p' - that is an UnManagedStruct
pointing to that. You know, that the return type is a struct screen *.

So you create an initializer for that struct (above layout? - a bad name
BTW) and *assign* it to the screen:

  assign screen, screen_struct_layout
  w = screen["w"]   # presumed your struct initializer defines that

s. docs/pmcs/struct.pod

> ... I can provide more code if necessary.

If its still not clear, yes please.

> -- c

leo

Reply via email to