2

Rainlendar is a fantastic cross platform calendar program that is written with wxWidgets. How does it achieve the transparency effect? Does anyone have any example code which demonstrates the transparency effect?

mghie
  • 32,028
  • 6
  • 87
  • 129
Frank
  • 1,003
  • 2
  • 13
  • 19

2 Answers2

3

My guess is that they could be using a wxScreenDC to draw directly to the screen (while preserving the background contents). Unlike receiving paint events or erase events, you create a wxScreenDC on the stack at your choosing, which means that you need to refresh yourself (most likely via a timer of some sort). If you don't, background applications will eventually repaint themselves over your wxScreenDC contents.

Here's the API listing

EDIT: Just to clarify, usage (besides the need to call StartDrawingOnTop and EndDrawingOnTop) is identical to any other wxDC.

GRB
  • 1,811
  • 3
  • 14
  • 10
1

wxTopLevelWindow::SetTransparent() method may be what you need.

T-Rex
  • 874
  • 1
  • 6
  • 20
  • SetTransparent makes the whole window transparent. The idea with this calendar (it appears) is that it draws fully opaque images onto transparent backgrounds (SetTransparent would make everything equally transparent). – GRB Apr 14 '09 at 15:43