Hello, imm trying to create a small window that shows me if a serice is running and displays a small icon that shows the status i created this function that checks if a PID is there:
gint check_samba(){ gint smb_pid2; gchar check_smb_cmd[512]; sprintf(check_smb_cmd, "cat /var/run/samba/smbd.pid 2>/dev/null"); //g_print("%s", check_smb_cmd); smb_pid2 = system(check_smb_cmd); //g_print("%s", smb_pid2); return smb_pid2; } the function is called here: gint smb_pid; smb_pid=check_samba(); //g_print("PID: %i", smb_pid); //while(1){ if(smb_pid > 0) { image1 = g_object_new(GTK_TYPE_IMAGE,"file", "pics/ledgreen.png", NULL); }else{ image1 = g_object_new(GTK_TYPE_IMAGE,"file", "pics/ledred.png", NULL); } //} gtk_widget_show (image1); So how can I check and if neccessary change the picture lets say every each 2 seconds? I thought i could use an endless while loop, but that didnt worked. Also the PID gets displayes when I call the function, but a g_print("PID: %i", smb_pid); give me (null) has been quite a while since i worked with C, so this may be a dump error by me. thx for your help _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list