GTK 1.2.8: resize problem



I'm using GTK 1.2.8 on a Linux system (Red Hat 7.0).
The main window of my application has an initial size. If the user
activates a specific menu entry, the size of the main window is resized
to the initial size again. Unfortunately, this doesn't work. If the user
starts my application, resizes the main window with the mouse and 
activates the menu item, nothing happen. It seems, that the main window
'thinks', that the size has not changed and therefore don't change the
size. Below is a test program, which can be used to reproduce the
problem
(taking the hello world example as a starting point):
If you start the program, you get a window with a button on it. If you
press the button, the window is resized to a width of 200 and a height 
of 100 (using the function gtk_widget_set_usize). Now, resize the window
with the mouse and press the button again. Surprisingly, the window is
NOT resized.
Any help?

        Roland Scholz

Here is the test program:

#include <gtk/gtk.h>

void hello( GtkWidget *widget, GtkWidget *win)
{
    gtk_widget_set_usize(win, 200, 100);
}

void destroy( GtkWidget *widget,
              gpointer   data )
{
    gtk_main_quit();
}

int 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_main_quit();
}

int 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_set_border_width (GTK_CONTAINER (window), 10);
    button = gtk_button_new_with_label ("Hello World");
    gtk_signal_connect (GTK_OBJECT (button), "clicked",
                        GTK_SIGNAL_FUNC (hello), (gpointer)window);
    gtk_container_add (GTK_CONTAINER (window), button);
    gtk_widget_show (button);
    gtk_widget_show (window);
    gtk_main ();
    
    return(0);
}




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]