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

gdk_window_get_position



/* 
Dear All,
This example gives me the right size (350, 250) for the window but 
the wrong position (0, 0). What am I doing wrong? Thanks! Carlos
*/

#include <gtk/gtk.h>

int main (int argc, char **argv)
{
GtkWidget *top_window;
gint x,y,w,h;
    
gtk_init (&argc, &argv);
top_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_uposition (top_window, 50, 100);
gtk_widget_set_usize (top_window, 350, 250);
gtk_widget_show (top_window);
gdk_window_get_size (top_window->window, &w, &h);
printf ("%d %d\n", w, h);
gdk_window_get_position (top_window->window, &x, &y);
printf ("%d %d\n", x, y);
gtk_main ();
}



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