tMake GtkLabels transparent if they are within a GtkNotebook, so that they look right in both "normal" Windows and when using fancy XP common controls. - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit d9c94eab146b61d69ab2f028fe913e79bb3acb25
(DIR) parent 31dd16378c0737c5d3f1a802d59b27ff2bebea89
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Tue, 27 Aug 2002 16:22:27 +0000
Make GtkLabels transparent if they are within a GtkNotebook, so that they
look right in both "normal" Windows and when using fancy XP common controls.
Diffstat:
M src/gtkport/gtkport.c | 12 ++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c
t@@ -621,6 +621,7 @@ static GtkClass GtkWindowClass = {
const GtkType GTK_TYPE_WINDOW = &GtkWindowClass;
const GtkType GTK_TYPE_MENU_BAR = &GtkMenuBarClass;
+const GtkType GTK_TYPE_NOTEBOOK = &GtkNotebookClass;
HINSTANCE hInst;
HFONT defFont;
t@@ -985,6 +986,17 @@ static BOOL HandleWinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
}
switch (msg) {
+ case WM_CTLCOLORSTATIC:
+ widget = GTK_WIDGET(myGetWindowLong((HWND)lParam, GWL_USERDATA));
+ if (widget && gtk_widget_get_ancestor(widget, GTK_TYPE_NOTEBOOK)) {
+ hDC = (HDC)wParam;
+ if (GTK_OBJECT(widget)->klass == &GtkLabelClass) {
+ SetBkMode(hDC, TRANSPARENT);
+ *dodef = FALSE;
+ return GetStockObject(NULL_BRUSH);
+ }
+ }
+ break;
case WM_DRAWITEM:
if ((lpdis = (LPDRAWITEMSTRUCT)lParam)
&& (widget = GTK_WIDGET(myGetWindowLong(lpdis->hwndItem, GWL_USERDATA)))