Creating a page setup dialog

You can create a page setup dialog by instantiating an instance of the class wx.PageSetupDialog.

wx.PageSetupDialog(parent, data=None)

The parent parameter is the parent window of the new dialog. The data parameter is an instance of wx.PageSetupDialogData—if you pass your own created

Figure 17.4

The wxPython page setup dialog box instance in, the dialog starts off displaying the values of that instance. Once created, the dialog behaves like any other modal dialog, and you can display it using ShowModal(). As usual, the return value indicates whether the user closed the window with the wx.ID_OK or the wx.ID_CANCEL button. After the dialog has closed, you can gain access to the data object by calling GetPageSetupDialogData(), which returns an instance to the class wx.PageSetupDialogData.

Was this article helpful?

0 0

Post a comment