Mattias Gaertner wrote:
On Sun, 06 Jan 2008 01:13:52 +0700
Bee <[EMAIL PROTECTED]> wrote:
Hi all,
I'd like to create a gtk(2) app that has a non-rectangular form
shape, using Lazarus of course. I know gtk(2) provides API for this
purpose. The API requires a pointer to GTKWidget. But, I couldn't
find any ways to get the widget pointer of Lazarus' form since
Lazarus wraps the API very well inside LCL.
Hints? TIA.
BTW... which API should I use for this purpose, gtk or gdk? Both
wrappers are provided in FPC/Lazarus and both provide similar API for
the purpose. In term of Lazarus' LCL, what are the differences
between both?
Both gtk and gdk are available in the gtk interface. I don't know,
which one you use for this.
If you need the gtkwindow, then just type cast Form1.Handle:
GtkWindow:=PGtkWindow(Form1.Handle);
Beware, that this is an internal LCL gtk interface structure and can
change in the future without warning.
And it will.
The right way to do it in laz 0.9.26 and up is:
GtkWindow := PGtkWindget(SomeWincontrol.Reference.Ptr);
This won't change. A Reference: TWSReference is the replacement for all
handles used in the LCL.
Unfortunately it is not yet implemented for TWincontrol, so for now you
need to cast the handle.
Marc
If you find out how to do it, it would be nice to write a small example
and describe it on the wiki. Eventually this feature could be added to
the LCL.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives