gtk.FontButton a button to launch a font selection dialog (new in PyGTK 2.4) Synopsis gtk.FontButton gtk.Button gtk.FontButton fontnameNone get_title set_title title get_use_font set_use_font use_font get_use_size set_use_size use_size get_font_name set_font_name fontname get_show_style set_show_style show_style get_show_size set_show_size show_size Ancestry +-- gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Bin +-- gtk.Button +-- gtk.FontButton Implemented Interfaces gtk.FontButton implements gtk.Buildable gtk.FontButton Properties gtk.Object Properties gtk.Widget Properties gtk.Container Properties gtk.Button Properties
"font-name" Read-Write The name of the currently selected font. "show-size" Read-Write If True, the selected font size will be shown in the label. For a more WYSIWIG way to show the selected size, see the "use-size" property. "show-style" Read-Write If True, the name of the selected font style will be shown in the label. For a more WYSIWIG way to show the selected style, see the "use-font" property. "title" Read-Write The title of the font selection dialog. "use-font" Read-Write If True, the label will be drawn in the selected font "use-size" Read-Write If True, the label will be drawn with the selected font size.
gtk.FontButton Style Properties gtk.Widget Style Properties gtk.Button Style Properties gtk.FontButton Signal Prototypes gobject.GObject Signal Prototypes gtk.Object Signal Prototypes gtk.Widget Signal Prototypes gtk.Container Signal Prototypes gtk.Button Signal Prototypes "font-set" callback fontbutton user_param1 ... Description This widget is available in PyGTK 2.4 and above. The gtk.FontButton is a button that displays the currently selected font and, when clicked, opens a gtk.FontSelectionDialog to change the font. A gtk.FontButton can be used in a preference dialog for selecting a font. Constructor gtk.FontButton fontnameNone fontname : the name of the font to display in the font selection dialog Returns : a new font button widget This constructor is available in PyGTK 2.4 and above. Creates a new gtk.FontButton that displays the font specified by fontname or the currently selected font if fontname is None or not specified. Methods gtk.FontButton.get_title get_title Returns : the title string This method is available in PyGTK 2.4 and above. The get_title() method returns the value of the "title" property that contains the title of the font selection dialog. gtk.FontButton.set_title set_title title title : a string containing the font selection dialog title This method is available in PyGTK 2.4 and above. The set_title() method sets the "title" property to the string specified by title and sets the title of the gtk.FontSelectionDialog if it exists. The "title" property contains the title of the font selection dialog. gtk.FontButton.get_use_font get_use_font Returns : True, if the font button label is written using the selected font. This method is available in PyGTK 2.4 and above. The get_use_font() method returns the value of the "use-font" property. If "use-font" is True the selected font is used in the label. gtk.FontButton.set_use_font set_use_font use_font use_font : If True, the font button label will be written using the font selected. This method is available in PyGTK 2.4 and above. The set_use_font() method sets the "use-font" property to the value specified by use_font. If use_font is True, the font button label will be written using the selected font. gtk.FontButton.get_use_size get_use_size Returns : True if the font button label is written using the selected size. This method is available in PyGTK 2.4 and above. The get_use_size() method returns the value of the "use-size" property. If the value of "use-size" is True, the font button label is written using the selected font size. gtk.FontButton.set_use_size set_use_size use_size use_size : If True, the font button label will be written using the selected size. This method is available in PyGTK 2.4 and above. The set_use_size() method sets the "use-size" property to the value of use_size. If use_size is True, the font button label will be written using the selected size. gtk.FontButton.get_font_name get_font_name Returns : the font name. This method is available in PyGTK 2.4 and above. The get_font_name() method returns the value of the "font-name" property that contains the name of the currently selected font. gtk.FontButton.set_font_name set_font_name fontname fontname : the name of the font to display in the font selection dialog Returns : True if the font selection dialog exists and the font name could be set This method is available in PyGTK 2.4 and above. The set_font_name() method sets the "font-name" property to the value of fontname and updates the currently-displayed font in the font selection dialog. Returns True if the font selection dialog exists and fontname could be set as its font. gtk.FontButton.get_show_style get_show_style Returns : True if the font style will be shown in the label. This method is available in PyGTK 2.4 and above. The get_show_style() method returns the value of the "show-style" property. If "show-style" is True, the name of the font style will be shown in the font button label. gtk.FontButton.set_show_style set_show_style show_style show_style : if True, the font style should be displayed in the font button label. This method is available in PyGTK 2.4 and above. The set_show_style() method sets the "show-style" property tot he value of show_style. If show_style is True, the font style will be displayed along with name of the selected font in the font button label. gtk.FontButton.get_show_size get_show_size Returns : True if the font size will be shown in the font button label. This method is available in PyGTK 2.4 and above. The get_show_size() method returns the value of the "show-size" property. If "show-size" is True, the font size will be shown in the font button label. gtk.FontButton.set_show_size set_show_size show_size show_size : if True, the font size should be displayed in the font button label. This method is available in PyGTK 2.4 and above. The set_show_size() method sets the "show-size" property to to the value of show_size. If show_size is True, the font size will be displayed along with the name of the selected font in the font button label. Signals The "font-set" gtk.FontButton Signal callback fontbutton user_param1 ... fontbutton : the fontbutton that received the signal user_param1 : the first user parameter (if any) specified with the connect() method ... : additional user parameters (if any) The "font-set" signal is emitted when the user selects a font. When handling this signal, use the get_font_name() method to find out what font was just selected.