Re: GTK 1.2.8: resize problem
- From: Carlos Pereira <carlos pehoe civil ist utl pt>
- To: gtk-app-devel-list gnome org
- Subject: Re: GTK 1.2.8: resize problem
- Date: Wed, 21 Mar 2001 21:00:46 GMT
I tried all of the above, but didn't get it to work.
This works:
Carlos
----------------
#include <gtk/gtk.h>
void hello( GtkWidget *widget, GtkWidget *win)
{
gint x, y, w, h;
static int step = 50;
gdk_window_get_size (win->window, &w, &h);
gdk_window_get_origin (win->window, &x, &y);
w += step;
h += step;
step *= -1;
gdk_window_move_resize (win->window, x, y, w, h);
}
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_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, TRUE);
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]