Re: Trouble using gdk_atom_intern(..)



Robin Verduijn <robin verduijn riversoft com> writes:

> Hi all,
> 
> I am looking for a way to make all running gnome apps re-read the .gtkrc file
> and update their appearance based on that. Sort of in the same way
> theme-selector-capplet makes them realize the .gtkrc file has changed. I have
> a script that changes my gtk theme once in a while and I need a way to notify
> applications of these changes. The code I came up with was this:
> 
> ------
> {
>     GdkEventClient rcevent;
> 
>     rcevent.type = GDK_CLIENT_EVENT;
>     rcevent.window = 0;
>     rcevent.send_event = TRUE;
>     rcevent.message_type = gdk_atom_intern("_GTK_READ_RCFILES", FALSE);
>     rcevent.data_format = 8;
>     gdk_event_send_clientmessage_toall((GdkEvent *) &rcevent);
>     return 0;
> }
> ------
> 
> However, this breaks at line 5 (the gdk_atom_intern(..) call).

If that breaks, it pretty much means that you haven't initialized
GTK+ - calling
 
 gtk_init (&argc, &argv);

At the top of your program.

> Does anyone know if, at least, I'm on the right path here and this code
> _could_ possibly work? Or is there something else wrong with this approach?
> Or if there's another way to make all gnome applications update their theme
> info I'd like to know how.
> 
> If I sent this to the wrong list, I do apologize. But there didn't seem to be
> a gnome-devel-list anywhere so I figured this must be the right one :)

Hmmm, gnome-devel-list gnome org?

 http://mail.gnome.org/mailman/listinfo/

                                        Owen




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