In my app, I'm using an IE Html Window. I have a button on there to print which calls the following function. I grabbed this function out of the demo, but I don't know the mechanics of handling printing in wxpython, and so this is a total shot in the dark. Can anyone guide me as to how to enable printing through a button? P.S. I can right-click on the html window, and a print option is available in the menu that comes up, which works correctly.
In my app, I'm using an IE Html Window. I have a button on there to
print which calls the following function. I grabbed this function out
of the demo, but I don't know the mechanics of handling printing in
wxpython, and so this is a total shot in the dark. Can anyone guide me
as to how to enable printing through a button? P.S. I can right-click
on the html window, and a print option is available in the menu that
comes up, which works correctly.
I would think if the menu option works, then you shouldn't have to define
anything else. If it's a toolbar button, just setting the ID to the same as
the menuitem's ID should be enough. In any event, you could probably direct
the button to point to the same event handler code as the menu item.
In my app, I'm using an IE Html Window. I have a button on there to print which calls the following function. I grabbed this function out of the demo, but I don't know the mechanics of handling printing in wxpython, and so this is a total shot in the dark. Can anyone guide me as to how to enable printing through a button?
If you want to handle printing yourself you really need to look closer at and experiment with the PrintFramework sample and the docs until you understand it. Unfortunatly just blindly copying code won't get you very far in this case.
P.S. I can right-click on the html window, and a print option is available in the menu that comes up, which works correctly.
That functionality is internal to the IE ActiveX control. There is probably a way to send a message to the IE window to cause it to start the print, but I don't have time to work out the details right now...
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!