Quote:
Actually, most of the things you need are in fact present in GTK+-2.16, but under different name. The only thing that is not available is gdk_pixbuf_simple_anim_set_loop() function, all others can be replaced with:
* gtk_widget_set_can_focus() -> GTK_WIDGET_(UN)SET_FLAGS() + GTK_CAN_FOCUS
* gtk_widget_get_sensitive() -> GTK_WIDGET_SENSITIVE()
* gtk_widget_get_visible() -> GTK_WIDGET_VISIBLE()
* gtk_widget_set_visible() -> gtk_widget_hide/show()
Okay, thanks. I'll see if I can get around gdk_pixbuf_simple_anim_set_loop() somehow too.
Quote:
As for 1, I'll check this when I get to my Windows XP install.
As for 2, what do you mean by very strangely? I did use text view a bit under windows some time ago and as far as I can remember, it worked just fine.
As for 3, I'm almost sure that the problem is in your application, since those things are generally handled by window manager directly and GTK+ acts here only as messenger that conveys your requests down to WM.
As for no.s 1 & 2, they're gone as soon as I'm using the MS-Windows theme. If I'm using the default theme, these problems are there. I don't know why this is like it is.
Problem no. 3 is a little bit more tricky. It's unlikely that it is an error of mine because I can easily reproduce it with some very simple code. You can see it for yourself with this code:
Code:
#include <gtk/gtk.h>
static GtkWidget *window2, *window3;
static void buttonclick1(GtkWidget *button_widget, gpointer data)
{
gtk_widget_show(window3);
}
static void buttonclick2(GtkWidget *button_widget, gpointer data)
{
gtk_widget_show(window2);
}
static gboolean windowclose(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
gtk_widget_hide(widget);
return TRUE; // prevent window destroying
}
int main (int argc, char *argv[])
{
GtkWidget *window1;
GtkWidget *button1, *button2, *button3, *vbox1, *vbox2;
gtk_init(&argc, &argv);
window1 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window1), "Window 1");
gtk_container_set_border_width(GTK_CONTAINER(window1), 10);
g_signal_connect_swapped(G_OBJECT(window1), "destroy", G_CALLBACK (gtk_main_quit), NULL);
vbox1 = gtk_vbox_new(FALSE, 0);
button1 = gtk_button_new_with_label("Button 1");
button2 = gtk_button_new_with_label("Button 2");
gtk_box_pack_start(GTK_BOX(vbox1), button1, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox1), button2, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(button1), "clicked", G_CALLBACK(buttonclick1), NULL);
g_signal_connect(G_OBJECT(button2), "clicked", G_CALLBACK(buttonclick2), NULL);
gtk_container_add(GTK_CONTAINER(window1), vbox1);
/***************************************************************************/
window2 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window2), "Window 2");
gtk_window_set_modal(GTK_WINDOW(window2), TRUE);
gtk_container_set_border_width(GTK_CONTAINER(window2), 10);
g_signal_connect(G_OBJECT(window2), "delete-event", G_CALLBACK(windowclose), NULL);
vbox2 = gtk_vbox_new(FALSE, 0);
button3 = gtk_button_new_with_label("Button 3");
gtk_box_pack_start(GTK_BOX(vbox2), button3, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(button3), "clicked", G_CALLBACK(buttonclick1), NULL);
gtk_container_add(GTK_CONTAINER(window2), vbox2);
gtk_widget_show(button3);
gtk_widget_show(vbox2);
/***************************************************************************/
window3 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window3), "Window 3");
gtk_window_set_modal(GTK_WINDOW(window3), TRUE);
gtk_container_set_border_width(GTK_CONTAINER(window3), 10);
g_signal_connect(G_OBJECT(window3), "delete-event", G_CALLBACK(windowclose), NULL);
gtk_widget_show_all(window1);
gtk_main();
return 0;
}
To get the problem, you have to do the following:
1) Click "Button 1" --> Window 3 opens up
2) close Window 3 again
3) Click "Button 2" --> Window 2 opens up
4) Click "Button 3" --> Window 3 opens up
5) Now the *whole* application locks up completely! It is not possible to click any more buttons or close any window. The application is completely gone, CPU goes to 100% usage and the whole app is simply dead. I don't know whether this happens on Linux or only Windows. But on Windows, it also happens with GTK 2.16 which is considered stable.
The problem is related to the gtk_window_set_modal() call. If I remove this, it works fine. BUT: The problem also sometimes appears with GtkFileChooserButton because that also opens a modal dialog and there's no way I could change that because I cannot get a GtkDialog handle from a GtkFileChooserButton.
So I'm currently stuck with this problem. For my own windows, I could work around the problem by leaving out gtk_window_set_modal() but I can't easily work around the problem when using GtkFileChooserButton.
Can you reproduce this problem under Linux or Windows? It really seems to be a critical bug because it freezes the whole application which is very bad because the user won't be able to save his changes :(( ...
Thanks, Andy