On Tue, Sep 5, 2017 at 3:36 PM, Charles Curley <[email protected]> wrote: > > > My problem is determining exactly what C code to use to get the return > from gnome_gps_get_resource() so that gtk_window_set_icon () can use it > without crashing. Is there an intermediate function I should call? Is > there a cast I am missing? >
I think you may want gnome_gps_register_resource() instead. According to https://developer.gnome.org/gio/unstable/GResource.html: >The register and unregister functions >register the resource so its files can >be accessed using >g_resources_lookup_data(). Once a GResource has been created and registered >all the data in >it can be accessed globally in the process by using API calls like >g_resources_open_stream() to >stream the data or g_resources_lookup_data() to get a direct pointer to the >data. And... >You can also use URIs like "resource:///org/gtk/Example/data/splashscreen.png" >with GFile to access the resource data. I think this last way is how the guy in the stackoverflow answer was doing it. The phrasing of the documentation is confusing, though. It seems that after makeing the call to gnome_gps_register_resource() you should be able to: gtk_window_set_icon_from_file (window, "resource:///com/whatever/path/iconfile.png", NULL); -John Shaver /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
