Why this simple threat program dont work properly?
- From: Boris Winter <boris winter hr>
- To: gtk-app-devel-list gnome org
- Subject: Why this simple threat program dont work properly?
- Date: Thu, 17 Feb 2005 23:02:15 +0100
please help ??
#include<gtk/gtk.h>
#include<stdio.h>
GtkWidget *window;
GtkWidget *poruka;
GtkWidget *label;
void *argument_thread(void *args){
unsigned long int b=0;
char a[10];
for(b;b<100000000;b++){
sprintf(a, "%u", b);
gtk_label_set(GTK_LABEL (label), a);
g_usleep(1000000);
}
}
int main(int argc, char *argv[]){
gtk_init(&argc, &argv);
g_thread_init(NULL);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK
(gtk_main_quit), NULL);
label = gtk_label_new ("0");
gtk_container_add (GTK_CONTAINER (window), label);
gtk_widget_show (label);
gtk_widget_show(window);
g_thread_create(argument_thread, 0, 1, 0);
gtk_main ();
return 0;
}
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14.2.2005
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]