[Lazarus] OSX: Handles and WindowRefs

Hans-Peter Diettrich DrDiettrich1 at aol.com
Mon Jan 12 03:23:55 CET 2009


Marc Weustink schrieb:

> Each Widgetset is free to return whatever it likes ad Handle to their 
> underlying data structures.
> As you can see in other replies, for carbon it was
>    AWindow  := WindowRef(TCarbonWidget(Form1.Handle).Widget);
> and now
>    AWindow  := TCarbonWindow(Form1.Handle).Window;
> 
> The idea behind TWInControl.Reference is to abstract this and to allow 
> direct widgetaccess the same time. In the future retrieving the window 
> would become something like:
>    AWindow := WinControl.Reference as ICarbonHiView).Window;
> 
> or similar for gtk
>    AWindow := WinControl.Reference as IGdkWindow).Window;

The (Windows) Handle already *is* an abstraction. Why not use it for 
every widgetset?

It may depend on the widgetset, what can be done with a Handle. This is 
where general methods (for every widgetset) and specific methods should 
be separated. We might sort out "true" Windows specific methods, and 
implement the remaining set of procedures/functions for every widgetset.

DoDi




More information about the Lazarus mailing list