top level panel's decorations

Hi All,
In order to ease the creation of application documentation I added a
screen-grab btn to my app's toolbar. The code snippet below implements
this functionality.

Is there a way (in Linux), to get the whole toplevel screen with all
it's decorations - status and toolbar, not only the client area?

def snapshot(self):
        """
        get a snapshot of the current screen and save to file
        """

        panel = wxGetTopLevelParent(self)
        context = wxClientDC(panel)
        
        memory = wxMemoryDC()
        x,y = panel.GetClientSizeTuple()
        bitmap = wxEmptyBitmap(x,y, -1)
        memory.SelectObject(bitmap)
        memory.Blit(0,0,x,y, context, 0,0)
        memory.SelectObject(wxNullBitmap)
        
        bitmap.SaveFile("test.png", wxBITMAP_TYPE_PNG)

regards

···

--
Thys Meintjes
BEng Electronic (UP), MEng Bio (UP)
Intrepid Investigator of Interesting Things
+27 82 3764 602

Thys Meintjes wrote:

Hi All,
In order to ease the creation of application documentation I added a
screen-grab btn to my app's toolbar. The code snippet below implements
this functionality.

Is there a way (in Linux), to get the whole toplevel screen with all
it's decorations - status and toolbar, not only the client area?

1) Use a wxWinbdowDC, rather than a wxClientDC to blit from

2) If you want the status bar and all, then you need the wxWindowDC of
the wxFrame

3) Beware that if there are other windows over yours, or a open menu or
something, that may be what you get.

4) I havn't actually tried this myself

5) You probably can't get all the window decorations at all: they are
drawn by the Window manager by in X, and wxWindows doesn't know anything
about them. However, you probably don't need that anyway.

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov