Re: Xlib function calls from gtk1.2 ( embed mozilla )



On Fri, 2004-05-14 at 03:13, ext Doug Herbert wrote:
For WM_COMMAND you could probably use GdkAtom and
gdk_property_*
functions.


Thanks for replying.

Its the WM_COMMAND property setting I am really
interested in. Currently I only know about using the
Xlib XSetCommand function.

Are you able to give me basic example of setting this
XWindow property using the GdkAtom object above ?

(I'm using exclusively gtk2, so the following might need adjusting to
gtk1.2, but should give you the basic idea.  Hopefully.)

I'm guessing it's something like the following (I'm not too familiar
with the atoms, especially the STRING (there's also TEXT, COMPOUND_TEXT
and UTF8_STRING, I don't know the difference.)

GtkWidget *window = gtk_window_new (...);
const char *command = "whatever";

GdkAtom *wm_command = gdk_atom_intern ("WM_COMMAND", FALSE);
gdk_property_change (window->window, wm_command,
                     gdk_atom_intern ("STRING", FALSE),
                     8, GDK_PROP_MODE_REPLACE,
                     command, strlen (command));


Also how do you get ( & know ) the top level window
id, to reference to set the WM_COMMAND property ?

gtk_widget_toplevel () and GDK_WINDOW_XID (window->window) probably.


-- 
Tommi Komulainen <tommi komulainen nokia com>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]