VOOZH about

URL: https://www.geeksforgeeks.org/python/wxpython-get-default-attributes-of-statictext/

⇱ wxPython - Get Default Attributes of StaticText - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

wxPython - Get Default Attributes of StaticText

Last Updated : 21 Sep, 2021

In this article, we are going to learn how can we get different attributes of StaticText like background, foreground colors, and fonts. We use GetClassDefaultAttributes() function to get an object of wx.VisualAttributes. It may or may not take variant as an argument.

Syntax: 
wx.StaticText.GetClassDefaultAttributes() 
or 
wx.StaticText.GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)

Parameters: 

ParameterInput TypeDescription
variantWindowVariantvariant for static text.

Return Type: 
wx.VisualAttributes
 

Code Example:  

Console Output: 
(240, 240, 240, 255) 
(0, 0, 0, 255)

Output Window: 

👁 Image


 

Comment