[pygtk-1.99.17 , gtk+-2.2.4, python-2.3.3]
>From my "Print View" menu callback I want to run a screengrab:
ag = gtk.AccelGroup()
self.itemf = gtk.ItemFactory(gtk.MenuBar, "<main>", ag)
self.topwin.add_accel_group(ag)
menu_items = ((('/_File/_Print View', '<control>V', self.print_view, 21, '')))
self.itemf.create_items(menu_items)
def print_view(self, dummy, unused):
parent_win = self.topwin.window.get_parent()
os.system("convert -page 588x740-14+335 X:0x%x 'PS2:|lpr'" %
self.topwin.window.xid)
[the "convert" linux command is from the ImageMagick package; very handy]
When I select the menu item, the menu disappears, but the underlying
window is not repainted until the menu callback returns. Thus the window
I'm trying to print is partially obscured while the screengrab is taking
place. Is there something I can do in
the menu callback to force the mainwindow to repaint? I tried putting in
a time.sleep(1) and gtk.gdk.flush() but those did not help.
The function works OK when called via the menu accelerator key sequence,
since the menu does not pop down and there's no obscuration.
But I have a lot of naive users that are not comfortble with accelerators.
-- George Young
--
"Are the gods not just?" "Oh no, child.
What would become of us if they were?" (CSL)
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/