Re: how to create "client area" widget?



Ivan Popivanov wrote:
I guess this question has been asked many times here:-), but I was unable to find anything in the archives. So, what's the way to create say a DrawingArea widget that covers the client area of the main window,

drawing_area=gtk_drawing_area_new();  // main drawing area
gtk_box_pack_start(GTK_BOX(vbox),drawing_area,TRUE,TRUE,0);

and have the DrawingArea resize automatically?

static gint
configure_event(GtkWidget *widget, GdkEventConfigure *event, gpointer data)
{
    ...
    gtk_widget_queue_draw(drawing_area);
    return FALSE;   // propagate
}

g_signal_connect(G_OBJECT(drawing_area),"configure_event",G_CALLBACK(configure_event),NULL);


What will happen if there are toolbars, menus etc? Does GTK automatically adjust the size and the position of the client area window, or the application has to take care for that?

gtk does it itself.




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