Need some pointers on the way Laz/fpc handle gtkwidgets if possible.

I am attempting (as a test) to get and then set the size and position of 
a Laz form using Gtk / Gdk - (not necessary I know, just leading to 
further things)

The Form1.Handle is a pointer to a gtkwidget - saved as 'WinHandle'.
 From this, I can retrieve its name, and so know I have the right pointer.
How can I alter the forms size / pos using the widget handle ?

TGtkWidget( PGtkWidget(Winhandle)^).allocation.width  - returns garbage
gtk_widget_size_request(Winhandle, @GtkAllocation) - returns 0's

Working on the theory that I have to use the GDKWindow instead,
TGtkWidget( PGtkWidget(Winhandle)^).Window - returns a number (no idea 
if its correct)
but trying to use it with any GDK_Window_ procedures gives various 
errors (depending on proc called)

Even simply attempting to get the TopLevel windows seems beyond me -
gList := gdk_window_get_toplevels();
gdk_window_get_position( GDK_WINDOW(gList^.data), pXPos, pYPos);

fails with 'GLib-GObject-CRITICAL - use IA__g_type_init() prior to this 
function
though I can easily accept that my understanding of glists is built on 
shakey ground

I know that Laz/fpc can handle most of this 'internally' for its own 
forms/controls - I am wanting to extend programming control outside of 
my app itself
eg - finding xcalc by name, moving / sizing / keystrokes / etc (not just 
xcalc obviously)

Any suggestions appreciated, as its damned frustrating knowing whats 
possible using Gtk/Gdk/GScreen/etc - and its just out of reach :)

Thanks - SteveG

_______________________________________________
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to