FontButton
Object Hierarchy:
Gtk.FontButton
Gtk.FontButton
Gtk.FontButton
Gtk.Button
Gtk.Button
Gtk.Button->Gtk.FontButton
Gtk.Bin
Gtk.Bin
Gtk.Bin->Gtk.Button
Gtk.Container
Gtk.Container
Gtk.Container->Gtk.Bin
Gtk.Widget
Gtk.Widget
Gtk.Widget->Gtk.Container
GLib.InitiallyUnowned
GLib.InitiallyUnowned
GLib.InitiallyUnowned->Gtk.Widget
GLib.Object
GLib.Object
GLib.Object->GLib.InitiallyUnowned
Atk.Implementor
Atk.Implementor
Atk.Implementor->Gtk.FontButton
Atk.Implementor->Gtk.Button
Atk.Implementor->Gtk.Bin
Atk.Implementor->Gtk.Container
Atk.Implementor->Gtk.Widget
Gtk.Buildable
Gtk.Buildable
Gtk.Buildable->Gtk.FontButton
Gtk.Buildable->Gtk.Button
Gtk.Buildable->Gtk.Bin
Gtk.Buildable->Gtk.Container
Gtk.Buildable->Gtk.Widget
Gtk.Actionable
Gtk.Actionable
Gtk.Actionable->Gtk.FontButton
Gtk.Actionable->Gtk.Button
Gtk.Activatable
Gtk.Activatable
Gtk.Activatable->Gtk.FontButton
Gtk.Activatable->Gtk.Button
Gtk.FontChooser
Gtk.FontChooser
Gtk.FontChooser->Gtk.FontButton
Description:
[
CCode ( type_id =
"gtk_font_button_get_type ()" ) ]
public class FontButton :
Button ,
Implementor ,
Actionable ,
Activatable ,
Buildable ,
FontChooser
The FontButton is a button which displays the currently selected font an allows to open a font chooser dialog
to change the font.
It is suitable widget for selecting a font in a preference dialog.
CSS nodes
GtkFontButton has a single CSS node with name button and style class .font.
Example: FontButton:
public class Application : Gtk.Window { public Application () { // Prepare Gtk.Window: this .title = "My Gtk.FontButton" ; this .window_position = Gtk.WindowPosition.CENTER; this .destroy.connect (Gtk.main_quit); // The button: Gtk.FontButton button = new Gtk.FontButton (); this .add (button); // Use the selected font & size to draw the button-label: button.use_font = true ; button.use_size = true ; // Sets the title for the font chooser dialog: button.set_title ("Pick your favourite font" ); // Connect a signal: button.font_set.connect (() => { // Emitted when a font has been chosen: unowned string name = button.get_font_name (); print ("Selected font: %s \n " , name); }); } public static int main (string [] args) { Gtk.init (ref args); Application app = new Application (); app.show_all (); Gtk.main (); return 0 ; } }
valac --pkg gtk+-3.0 Gtk.FontButton.vala
Content:
Properties:
public string font_name { get ; set ; }
The name of the currently selected font.
public bool show_size { get ; set ; }
If this property is set to true , the
selected font size will be shown in the label.
public bool show_style { get ; set ; }
If this property is set to true , the
name of the selected font style will be shown in the label.
public string title { get ; set ; }
The title of the font chooser dialog.
public bool use_font { get ; set ; }
If this property is set to true , the
label will be drawn in the selected font.
public bool use_size { get ; set ; }
If this property is set to true , the
label will be drawn with the selected font size.
Creation methods:
Methods:
public unowned string get_font_name ()
Retrieves the name of the currently selected font.
public bool get_show_size ()
Returns whether the font size will be shown in the label.
public bool get_show_style ()
Returns whether the name of the font style will be shown in the label.
public unowned string get_title ()
Retrieves the title of the font chooser dialog.
public bool get_use_font ()
Returns whether the selected font is used in the label.
public bool get_use_size ()
Returns whether the selected size is used in the label.
public bool set_font_name (string fontname)
Sets or updates the currently-displayed font in font picker dialog.
public void set_show_size (bool show_size)
If show_size
is true ,
the font size will be displayed along with the name of the selected font.
public void set_show_style (bool show_style)
If show_style
is true ,
the font style will be displayed along with name of the selected font.
public void set_title (string title)
Sets the title for the font chooser dialog.
public void set_use_font (bool use_font)
If use_font
is true ,
the font name will be written using the selected font.
public void set_use_size (bool use_size)
If use_size
is true ,
the font name will be written using the selected size.
Signals:
Inherited Members:
All known members inherited from class Gtk.Button
All known members inherited from class Gtk.Bin
All known members inherited from class Gtk.Container
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface Atk.Implementor
All known members inherited from interface Gtk.Actionable
All known members inherited from interface Gtk.Activatable
All known members inherited from interface Gtk.Buildable
All known members inherited from interface Gtk.FontChooser