Monday, September 23, 2024
Google search engine
HomeLanguageswx.DisplaySize() function in wxPython

wx.DisplaySize() function in wxPython

In this article, we are going to learn about DisplaySize() function present in wxPython. DisplaySize() function is one of the parent function of wxPython. It returns the display size in pixels. Either of output pointers can be None if the caller is not interested in the corresponding value.

Syntax:
wx.DisplaySize()

Parameters:
DisplaySize() 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()
  
    # method for creation of user interface
    def InitUI(self):
  
        # print the size of display
        print(wx.DisplaySize())
  
# 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:

(1536, 864)

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments