Open In App

wxPython – IsEllipsized() function in wx.StaticText

Last Updated : 18 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

In this article we are going to learn about IsEllipsized() function associated with wx.StaticText class of wxPython. IsEllipsized() function is used to return True if the window styles for this control contains one of the ST_ELLIPSIZE_START, ST_ELLIPSIZE_MIDDLE or ST_ELLIPSIZE_END styles.

Syntax: wx.StaticText.IsEllipsized(Self)

Parameters: No parameters required.

Return Type: bool

Code Example:




import wx
  
  
class Example(wx.Frame):
  
    def __init__(self, *args, **kwargs):
        super(Example, self).__init__(*args, **kwargs)
        self.InitUI()
  
    def InitUI(self):
        self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
        self.pnl = wx.Panel(self)
  
        bmp = wx.Bitmap('right.png')
        # CREATE STATICTEXT AT POINT (20, 20)
        self.st = wx.StaticText(self.pnl, id = 1, label ="This is the Label.",
                                pos =(20, 20), size = wx.DefaultSize, 
                                style = wx.ST_ELLIPSIZE_MIDDLE, name ="statictext")
  
        # CHECK ELLIPSIZED STYLE
        if(self.st.IsEllipsized()== True):
            print("Ellipsized")
        else:
            print("Not Ellipsized")
        self.SetSize((350, 250))
        self.SetTitle('wx.Button')
        self.Centre()
  
def main():
    app = wx.App()
    ex = Example(None)
    ex.Show()
    app.MainLoop()
  
  
if __name__ == '__main__':
    main()


Console Output:

Ellipsized

Output Window:



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads