diff --git a/src/preferences/keymap/KeymapWindow.cpp b/src/preferences/keymap/KeymapWindow.cpp index cb4310f90d..8df65fcbb5 100644 --- a/src/preferences/keymap/KeymapWindow.cpp +++ b/src/preferences/keymap/KeymapWindow.cpp @@ -66,7 +66,6 @@ KeymapWindow::KeymapWindow() fMapView = new MapView(BRect(150, 9, 600, 189), "mapView", &fCurrentMap); placeholderView->AddChild(fMapView); - fMapView->SetViewColor(B_TRANSPARENT_COLOR); BMenuItem *item = fFontMenu->FindMarked(); if (item) { @@ -928,16 +927,19 @@ MapView::_InitOffscreen() } } + void MapView::AttachedToWindow() { - SetEventMask(B_KEYBOARD_EVENTS, 0); - fTextView->SetViewColor(255, 255, 255); - _InitOffscreen(); - BControl::AttachedToWindow(); + + SetEventMask(B_KEYBOARD_EVENTS, 0); + SetViewColor(B_TRANSPARENT_COLOR); + fTextView->SetViewColor(255, 255, 255); + _InitOffscreen(); } + void MapView::_DrawBackground(){ BRect r = fOffscreenView->Bounds(); @@ -1587,4 +1589,4 @@ MapView::SetFontFamily(const font_family family) { fCurrentFont.SetFamilyAndStyle(family, NULL); fTextView->SetFontAndColor(&fCurrentFont); -}; +}