Once you have the dialog, you can display it using the standard ShowModal() method that will return wx.lD_OK or wx.lD_CANCEL depending on how the dialog is closed by the user. After you close the dialog, you can get to the data that the user entered with the method GetPrintDialogData(). You can also get to the printer device context associated with that data using the method GetPrintDC(), which will return None if no context has been created yet. The OnPrintSetup() method of the example in listing 17.1 displays how this dialog may be retrieved in practice.
Was this article helpful?