Bug 42 - Replace get_geometry() calls when painting
Status:
RESOLVED FIXED
Component:
GUI :: gtkmm
Version:
unspecified
Hardware:
All All
Importance:
P3 normal
Target Milestone:
---
Assignee:
Rob Caelers
URL:
Depends on:
Blocks:
Reported:
Sep 5 2002 21:48:56 UTC
by:
Raymond Penners
Modified:
Oct 22 2002 01:54:46 UTC
WhoWhenWhatRemovedAdded
Rob CaelersSep 5 2002 23:06:03 UTCstatusNEWRESOLVED
resolutionFIXED
Description
Raymond Penners  Sep 5 2002 21:48:56 UTC
When painting a widget...

  window->get_geometry(winx, winy, winw, winh, wind);

...is not the proper way to retrieve the area of where to paint.
This is the correct way:

  GtkAllocation alloc = get_allocation()

This was causing the missing 3D border around various windows.
Comment 1
Raymond Penners  Sep 5 2002 21:50:07 UTC
Perhaps this is already clear, but just in case: draw(0,0,w,h) should become
draw(alloc.x, alloc.y, alloc.width, alloc.height), so (0,0) is not always the
origin.
Comment 2
Rob Caelers  Sep 5 2002 22:41:26 UTC
I tried this for the TimeBar. get_allocation seems to return coordinates
relative to the entire window (for the timebar in mainwindow the upper-left
corner of the mainwindow, not the upper-left corner of the timebar itself....).
TimeBar derives from DrawingArea. I assume that this Widhet has its own window
(with coordinate (0,0) and all drawing operation are relative to this.
Comment 3
Rob Caelers  Sep 5 2002 23:06:03 UTC
Fixed