Re: [lazarus] accessing internal widgetset handle

2008-01-06 Thread Felipe Monteiro de Carvalho
Some documentation to access the interfaces directly is in the wiki:

http://wiki.lazarus.freepascal.org/Accessing_the_Interfaces_directly

But, as said, some recent changes were made.

-- 
Felipe Monteiro de Carvalho

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] accessing internal widgetset handle

2008-01-05 Thread Bee

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?


-Bee-

has Bee.ography at:
http://beeography.wordpress.com

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] accessing internal widgetset handle

2008-01-05 Thread Mattias Gaertner
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.

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


Re: [lazarus] accessing internal widgetset handle

2008-01-05 Thread Marc Weustink

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


Re: [lazarus] accessing internal widgetset handle

2008-01-05 Thread Marc Santhoff
Am Sonntag, den 06.01.2008, 01:13 +0700 schrieb Bee:
 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?

Normally I'd tend to use gdk, but I'm not sure (it's been a whilesince I
fiddled with that directly ...).

You could look at some GTK/GDK docs and tutorials or ask on their
mailing list. ( should be gtk-app-devel-list at gnome dot org )

HTH,
Marc


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives