here is small piece of code for setting my own image as icon. It seems there is a issue with the following code.
#include <gtk/gtk.h>
GtkWidget *window = NULL;
static void activate( GtkApplication *app, gpointer user_data )
{
window = gtk_application_window_new( app );
// icon image file is /usr/share/icons/my_own_icon.png
gtk_window_set_icon_name( GTK_WINDOW( window ), "my_own_icon" );
gtk_widget_show( window );
}
int main( int argc, char **argv )
{
GtkApplication *app = gtk_application_new ("my.own.application", G_APPLICATION_FLAGS_NONE);
if( g_signal_connect( app, "activate", G_CALLBACK( activate ), NULL ) <= 0 )
{
fprintf( stderr, "Unable to connect\n" );
exit(1);
}
int status = g_application_run( G_APPLICATION( app ), argc, argv);
g_object_unref( app );
return status;
}
can someone help me what is the issue with the code ?