Class: Iup::FontDialog
Overview
A predefined modal dialog to select a font.
Example
dlg = Iup::FontDialog.new do
d.title = "Select a new font"
d.font = "Times, bold 18"
end
dlg.popup
Note that popup must be used to show the dialog.
Instance Attribute Summary
Attributes inherited from Widget
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ FontDialog
constructor
Creates a new dialog.
-
#parentdialog ⇒ Object
–.
-
#parentdialog=(parent) ⇒ Object
:nodoc:.
-
#popup(x = 0, y = 0) ⇒ Object
Shows the dialog at position x, y.
-
#previewtext ⇒ Object
:attr: previewtext The text to use for preview of font selection.
-
#status ⇒ Object
:attr_reader: status returns ‘1’ if ‘OK’ pressed, or null.
-
#title ⇒ Object
:attr: title Title text for the message dialog.
-
#value ⇒ Object
:attr: value Initial value of font for dialog, and return value if ‘OK’ pressed.
Methods inherited from Widget
#active, #assign_handle, #bgcolor, #destroy, #enterwindow_cb=, #fgcolor, #font, #getfocus_cb=, #help_cb=, #k_any=, #killfocus_cb=, #leavewindow_cb=, #map_cb=, #maxsize, #minsize, #open_controls, #size, #unmap_cb=, #visible, #wid, #zorder
Methods included from AttributeBuilders
#define_attribute, #define_id_attribute, #define_id_reader, #define_id_writer, #define_property_attribute, #define_property_reader, #define_property_writer, #define_reader, #define_writer
Methods included from CallbackSetter
Constructor Details
#initialize {|_self| ... } ⇒ FontDialog
Creates a new dialog. If a block is given, the new instance is yielded to it.
19 20 21 22 23 |
# File 'lib/wrapped/fontdialog.rb', line 19 def initialize @handle = IupLib.IupFontDlg yield self if block_given? end |
Instance Method Details
#parentdialog ⇒ Object
–
42 43 44 |
# File 'lib/wrapped/fontdialog.rb', line 42 def parentdialog attribute_reference('PARENTDIALOG', Dialog, nil) end |
#parentdialog=(parent) ⇒ Object
:nodoc:
46 47 48 |
# File 'lib/wrapped/fontdialog.rb', line 46 def parentdialog= parent # :nodoc: attribute_reference('PARENTDIALOG', Dialog, parent) end |
#popup(x = 0, y = 0) ⇒ Object
Shows the dialog at position x, y.
-
x- x-coordinate to use, or one of show constants -
y- y-coordinate to use, or one of show constants
28 29 30 |
# File 'lib/wrapped/fontdialog.rb', line 28 def popup x=0, y=0 IupLib.IupPopup @handle, x, y end |
#previewtext ⇒ Object
:attr: previewtext The text to use for preview of font selection.
53 |
# File 'lib/wrapped/fontdialog.rb', line 53 define_attribute :previewtext |
#status ⇒ Object
:attr_reader: status returns ‘1’ if ‘OK’ pressed, or null
58 |
# File 'lib/wrapped/fontdialog.rb', line 58 define_reader :status |
#title ⇒ Object
:attr: title Title text for the message dialog.
63 |
# File 'lib/wrapped/fontdialog.rb', line 63 define_attribute :title |
#value ⇒ Object
:attr: value Initial value of font for dialog, and return value if ‘OK’ pressed.
68 |
# File 'lib/wrapped/fontdialog.rb', line 68 define_attribute :value |