Public bug reported:
Ubuntu 9.04, Intel Core 2 Quad
libglib2.0-0: 2.20.1-0ubuntu2
ibgtk2.0-0: 2.16.1-0ubuntu2
When using g_idle_add() in GTK+ apps the gtkFileChooser stops workning.
The following test code show the bug on my Ubuntu 9.04 system,
but the bug is not pressent under MinGW/WinXP.
The test app has a button that spawns a gtkFileChooser dialog.
if you uncomment the line g_idle_add(...) the dialog works,
otherwise it will be nonfunctioning
--------------------------------------------------------------
#include <gtk/gtk.h>
void
hello (void)
{
g_print ("Hello World\n");
}
void
destroy (void)
{
gtk_main_quit ();
}
gboolean G_MODULE_EXPORT handler(gpointer data){
printf("Idle Handler running\n");
return TRUE;
}
void opendialog(void){
GtkWidget *filedialog;
filedialog = gtk_file_chooser_dialog_new ("Open File", NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN,
GTK_RESPONSE_ACCEPT, NULL);
GtkFileFilter *filter;
filter = gtk_file_filter_new();
gtk_file_filter_add_pattern(filter, "*.xml");
gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(filedialog), filter);
if (gtk_dialog_run (GTK_DIALOG (filedialog)) == GTK_RESPONSE_ACCEPT)
{
char *filename;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER
(filedialog));
g_free (filename);
}
gtk_widget_destroy(filedialog);
}
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *button;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (destroy), NULL);
gtk_container_border_width (GTK_CONTAINER (window), 10);
button = gtk_button_new_with_label ("Hello World");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (opendialog), NULL);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",hello,GTK_OBJECT
(window));
gtk_container_add (GTK_CONTAINER (window), button);
gtk_widget_show (button);
gtk_widget_show (window);
//Uncomment line below to remove bug
g_idle_add(handler,NULL);
gtk_main ();
return 0;
}
** Affects: ubuntu
Importance: Undecided
Status: New
--
g_idle_add() disrupts gtkFileChooser dialog
https://bugs.launchpad.net/bugs/386688
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs