Class: Iup::FontDialog

Inherits:
Widget
  • Object
show all
Defined in:
lib/wrapped/fontdialog.rb

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

#handle

Instance Method Summary collapse

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

#define_callback

Constructor Details

#initialize {|_self| ... } ⇒ FontDialog

Creates a new dialog. If a block is given, the new instance is yielded to it.

Yields:

  • (_self)

Yield Parameters:



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

#parentdialogObject



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

Shows the dialog at position x, y.



28
29
30
# File 'lib/wrapped/fontdialog.rb', line 28

def popup x=0, y=0
  IupLib.IupPopup @handle, x, y
end

#previewtextObject

:attr: previewtext The text to use for preview of font selection.



53
# File 'lib/wrapped/fontdialog.rb', line 53

define_attribute :previewtext

#statusObject

:attr_reader: status returns ‘1’ if ‘OK’ pressed, or null



58
# File 'lib/wrapped/fontdialog.rb', line 58

define_reader :status

#titleObject

:attr: title Title text for the message dialog.



63
# File 'lib/wrapped/fontdialog.rb', line 63

define_attribute :title

#valueObject

: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