GimpUi.SizeEntry.new
function new(number_of_fields: Number(gint), unit: Gimp.Unit, unit_format: String, menu_show_pixels: Boolean, menu_show_percent: Boolean, show_refval: Boolean, spinbutton_width: Number(gint), update_policy: GimpUi.SizeEntryUpdatePolicy): Gtk.Widget {
// Gjs wrapper for gimp_size_entry_new()
}
Creates a new GimpUi.SizeEntry widget.
To have all automatic calculations performed correctly, set up the widget in the following order:
2. (for each additional input field) GimpUi.SizeEntry.prototype.add_field
3. GimpUi.SizeEntry.prototype.set_unit
For each input field:
4. GimpUi.SizeEntry.prototype.set_resolution
5. GimpUi.SizeEntry.prototype.set_refval_boundaries (or GimpUi.SizeEntry.prototype.set_value_boundaries)
6. GimpUi.SizeEntry.prototype.set_size
7. GimpUi.SizeEntry.prototype.set_refval (or GimpUi.SizeEntry.prototype.set_value)
The GimpUi.SizeEntry is derived from Gtk.Grid and will have an empty border of one cell width on each side plus an empty column left of the GimpUi.UnitComboBox to allow the caller to add labels or a GimpUi.ChainButton.
- number_of_fields
The number of input fields.
- unit
The initial unit.
- unit_format
A printf-like unit-format string as is used with gimp_unit_menu_new().
- menu_show_pixels
true if the unit menu should contain an item for GIMP_UNIT_PIXEL (ignored if the update_policy is not GIMP_SIZE_ENTRY_UPDATE_NONE).
- menu_show_percent
true if the unit menu should contain an item for GIMP_UNIT_PERCENT.
- show_refval
true if you want an extra "reference value" spinbutton per input field.
- spinbutton_width
The minimal horizontal size of the Gtk.SpinButton's.
- update_policy
How the automatic pixel <-> real-world-unit calculations should be done.
- Returns
A Pointer to the new GimpUi.SizeEntry widget.