hi everyone,
as gtk is event driven, does anyone know how i can create a program that can send "clicked" signals on its own without user input?
e.g.
void push_item( GtkWidget *widget,
gpointer data )
{
static int count = 1;
char buff[20];
sprintf (buff, "Item %d", count++);
gtk_statusbar_push (GTK_STATUSBAR (status_bar), GPOINTER_TO_INT (data), buff);
return;
}
int main (int argc, char *argv[])
{
...
context_id = gtk_statusbar_get_context_id(
GTK_STATUSBAR (status_bar), "Statusbar example");
button = gtk_button_new_with_label ("push item");
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (push_item), GINT_TO_POINTER (context_id));
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 2);
gtk_widget_show (button);
gtk_widget_show (window);
gtk_main ();
return 0;
}
push_item is a function that displays item %d, which increases each time "clicked" signal is sent from the main function.
so how do i code this so that the user need not click the mouse, but a "clicked" signal is sent?
gpointer data )
{
static int count = 1;
char buff[20];
sprintf (buff, "Item %d", count++);
gtk_statusbar_push (GTK_STATUSBAR (status_bar), GPOINTER_TO_INT (data), buff);
return;
}
int main (int argc, char *argv[])
{
...
context_id = gtk_statusbar_get_context_id(
GTK_STATUSBAR (status_bar), "Statusbar example");
button = gtk_button_new_with_label ("push item");
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (push_item), GINT_TO_POINTER (context_id));
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 2);
gtk_widget_show (button);
gtk_widget_show (window);
gtk_main ();
return 0;
}
push_item is a function that displays item %d, which increases each time "clicked" signal is sent from the main function.
so how do i code this so that the user need not click the mouse, but a "clicked" signal is sent?
thanks
aaron
Do you Yahoo!?
All your favorites on one personal page ? Try My Yahoo!
_______________________________________________ gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list