Please explain what I am doing wrong...
- From: Stefan Mars <mars lysator liu se>
- To: GTK list <gtk-list redhat com>
- Subject: Please explain what I am doing wrong...
- Date: Thu, 9 Jul 1998 22:37:47 +0200 (MET DST)
Could someone please explain to me why the code below doesn't color the
drawingarea black? And yes, gtk_widget_show is called on everything, it
compiles cleanly etc...
It would be nice if someone could help me, because I have gone through the
scribble-simple example, and as I understand it this is the way to do it
(though apparently I am wrong).
-Stefan
GtkWidget *omgCreateMainMenu( GtkWidget *drawingArea) {
gint width, height, nr_rows, dx, dy, depth;
GdkPixmap *menupixmap;
gdk_window_get_geometry( drawingArea->window, NULL, NULL, &width,
&height, &depth);
nr_rows = (int)(height / MENUITEMHEIGHT);
dy = (int)((height - MENUITEMHEIGHT * nr_rows) / 2);
dx = (int)((width - MENUITEMWIDTH) / 2);
if (dx < 0)
dx = 0;
width = MENUITEMWIDTH;
height = MENUITEMHEIGHT * nr_rows;
menupixmap = gdk_pixmap_new( drawingArea->window, width, height, depth);
gdk_draw_rectangle (menupixmap,
drawingArea->style->black_gc,
TRUE,
0, 0,
width,
height);
gdk_draw_pixmap(drawingArea->window,
drawingArea->style->fg_gc[GTK_WIDGET_STATE(drawingArea)],
menupixmap,
0, 0,
0, 0,
width, height);
return drawingArea;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]