On 1/21/06, Danny Milosavljevic <[EMAIL PROTECTED]> wrote:
> I would guess you only need to realize the window (so that it has a GDK
> - i.e. X - drawable, for example)
>
> You could also connect to the "realize" signal to only be notified when
> the window is realized and save the drawable there.
Well ..... fell free to try those things and submit a patch if they work =)
I don´t know much about Gtk and X11. I just copyed the GtkTrayIcon
component form Andrew Heines and adapted it to my interface, changing
the code until it worked =P
> If anything is unclear with gtk2 stuff, just ask me :)
The following lines on gtk1 interface:
procedure TWidgetTrayIcon.CreateForm(id: Integer);
begin
.....
fDisplay := GDK_WINDOW_XDISPLAY(Pointer(PGtkWidget(GtkForm.Handle)^.window));
// SHowMessage(IntToStr(Integer(fDisplay)));
fWindow := GDK_WINDOW_XWINDOW (Pointer(PGtkWidget(GtkForm.Handle)^.window));
fScreen := XDefaultScreenOfDisplay(fDisplay); // get the screen
fScreenID := XScreenNumberOfScreen(fScreen); // and it's number
end;
GDK_WINDOW_XDISPLAY doesn´t exist on the Gtk2 interface. It´s a X11
specific MACRO. I tryed to substitute this with:
fDisplay := GDK_DISPLAY;
// SHowMessage(IntToStr(Integer(fDisplay)));
Widget := PGtkWidget(GtkForm.Handle);
fWindow := PX11GdkDrawable(PGdkWindowObject(Widget^.window)^.impl)^.xid;
fScreen := XDefaultScreenOfDisplay(fDisplay); // get the screen
fScreenID := XScreenNumberOfScreen(fScreen); // and it's number
But the Icon doesn´t show (I have no idea why).
Any help is appreciated =)
thanks,
--
Felipe Monteiro de Carvalho
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives