Monday, October 6, 2025
HomeLanguageswxPython – wx.DisplaySizeMM() function in wxPython

wxPython – wx.DisplaySizeMM() function in wxPython

In this article we are going to learn about DisplaySizeMM() function present in wxPython. DisplaySizeMM() function is one of the parent function of wxPython. DisplaySizeMM() function is similar to the DisplaySize() function the only difference is that DisplaySizeMM() function returns dimensions in millimeters. Either of output pointers can be None if the caller is not interested in the corresponding value.

Syntax: wx.DisplaySizeMM()

Parameters: DisplaySizeMM() function requires no parameters.

Returns: ( width, height )

Return Type: tuple

Code Example:




# importing the module
import wx
  
# definition of the Example class
class Example(wx.Frame):
  
    # instantiating the class  
    def __init__(self, *args, **kwargs):
        super(Example, self).__init__(*args, **kwargs)
  
        self.InitUI()
  
    def InitUI(self):
        # print the size of display in millimeters
        print(wx.DisplaySizeMM())
   
# definition of the main function
def main():
  
    # creating an App object
    app = wx.App()
  
    # creating an Example object
    ex = Example(None)
  
    # showing the Example object
    ex.Show()
  
    # running the App object
    app.MainLoop()
   
# driver code
if __name__ == '__main__':
    main()


Output:

(406, 229)
Last Updated :
01 Aug, 2020
Like Article
Save Article

<!–

–>

Similar Reads
Related Tutorials
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32338 POSTS0 COMMENTS
Milvus
86 POSTS0 COMMENTS
Nango Kala
6707 POSTS0 COMMENTS
Nicole Veronica
11871 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11936 POSTS0 COMMENTS
Shaida Kate Naidoo
6825 POSTS0 COMMENTS
Ted Musemwa
7090 POSTS0 COMMENTS
Thapelo Manthata
6779 POSTS0 COMMENTS
Umr Jansen
6782 POSTS0 COMMENTS