GimpUi.NumberPairEntry¶
- Subclasses:
 None
Methods¶
- Inherited:
 Gtk.Entry (76), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.CellEditable (3), Gtk.Editable (13)
- Structs:
 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
Properties¶
- Inherited:
 
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w  | 
Whether to allow simplification  | 
||
r/w  | 
The value as aspect  | 
||
r/w  | 
The default left number  | 
||
r/w  | 
The default right number  | 
||
r/w  | 
String to show when in automatic mode  | 
||
r/w  | 
The left number  | 
||
r/w  | 
Maximum value valid when parsing input  | 
||
r/w  | 
Minimum value valid when parsing input  | 
||
r/w  | 
The value as ratio  | 
||
r/w  | 
The right number  | 
||
r/w/co  | 
A string of valid separators  | 
||
r/w  | 
Whether the widget is in ‘user override’ mode  | 
Style Properties¶
- Inherited:
 
Signals¶
- Inherited:
 Gtk.Entry (15), Gtk.Widget (69), GObject.Object (1), Gtk.CellEditable (2), Gtk.Editable (3)
Name  | 
Short Description  | 
|---|---|
Fields¶
Class Details¶
- class GimpUi.NumberPairEntry(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
A
Gtk.Entrysubclass to enter ratios.- classmethod new(separators, allow_simplification, min_valid_value, max_valid_value)¶
 - Parameters:
 - Returns:
 The new
GimpUi.NumberPairEntrywidget.- Return type:
 
Creates a new
GimpUi.NumberPairEntrywidget, which is aGtk.Entrythat accepts two numbers separated by a separator. Typical input example with a ‘x’ separator: “377x233”.The widget supports simplification of the entered ratio when the input ends in ‘=’, if “allow-simplification” is
True.The “separators” property contains a string of characters valid as separators when parsing input. The first separator is used when displaying the current values.
It is possible to specify what range of values that shall be considered as valid when parsing user input, by changing “min-valid-value” and “max-valid-value”.
The first separator of separators is used to display the current value.
New in version 2.4.
- get_aspect()¶
 - Returns:
 The entry’s current aspect.
- Return type:
 
Gets the aspect of the ratio displayed by a
GimpUi.NumberPairEntry.New in version 2.4.
- get_default_text()¶
 - Returns:
 the string manually set to be shown, or
Noneif values are shown in a normal fashion.- Return type:
 
New in version 2.4.
- get_default_values()¶
 - Returns:
 - Return type:
 
New in version 2.4.
- get_ratio()¶
 - Returns:
 The ratio value.
- Return type:
 
Retrieves the ratio of the numbers displayed by a
GimpUi.NumberPairEntry.New in version 2.4.
- get_user_override()¶
 - Returns:
 Whether or not the the widget is in user overridden mode.
- Return type:
 
New in version 2.4.
- get_values()¶
 - Returns:
 - Return type:
 
Gets the numbers displayed by a
GimpUi.NumberPairEntry.New in version 2.4.
- set_aspect(aspect)¶
 - Parameters:
 aspect (
GimpUi.AspectType) – The new aspect.
Sets the aspect of the ratio by swapping the left_number and right_number if necessary (or setting them to 1.0 in case that aspect is
GimpUi.AspectType.SQUARE).New in version 2.4.
- set_default_text(string)¶
 - Parameters:
 string (
str) – Default string.
Causes the entry to show a given string when in automatic mode, instead of the default numbers. The only thing this does is making the
GimpUi.NumberPairEntryshowing this string, the internal state and API calls are not affected.Set the default string to
Noneto display default values as normal.New in version 2.4.
- set_default_values(left, right)¶
 - Parameters:
 
New in version 2.4.
- set_ratio(ratio)¶
 - Parameters:
 ratio (
float) – Ratio to set in the widget.
Sets the numbers of the
GimpUi.NumberPairEntryto have the desired ratio. If the new ratio is different than the previous ratio, the “ratio-changed” signal is emitted.An attempt is made to convert the decimal number into a fraction with left_number and right_number < 1000.
New in version 2.4.
- set_user_override(user_override)¶
 - 
When the entry is not in user overridden mode, the values will change when the default values are changed. When in user overridden mode, setting default values will not affect the active values.
New in version 2.4.
 
- set_values(left, right)¶
 - 
Forces setting the numbers displayed by a
GimpUi.NumberPairEntry, ignoring if the user has set their own value. The state of user-override will not be changed.New in version 2.4.
 
Signal Details¶
- GimpUi.NumberPairEntry.signals.numbers_changed(number_pair_entry)¶
 - Signal Name:
 numbers-changed- Flags:
 - Parameters:
 number_pair_entry (
GimpUi.NumberPairEntry) – The object which received the signal
- GimpUi.NumberPairEntry.signals.ratio_changed(number_pair_entry)¶
 - Signal Name:
 ratio-changed- Flags:
 - Parameters:
 number_pair_entry (
GimpUi.NumberPairEntry) – The object which received the signal
Property Details¶
- GimpUi.NumberPairEntry.props.allow_simplification¶
 - 
Whether to allow simplification
 
- GimpUi.NumberPairEntry.props.aspect¶
 - Name:
 aspect- Type:
 - Default Value:
 - Flags:
 
The value as aspect
- GimpUi.NumberPairEntry.props.default_left_number¶
 - 
The default left number
 
- GimpUi.NumberPairEntry.props.default_right_number¶
 - 
The default right number
 
- GimpUi.NumberPairEntry.props.default_text¶
 - 
String to show when in automatic mode
 
- GimpUi.NumberPairEntry.props.left_number¶
 - 
The left number
 
- GimpUi.NumberPairEntry.props.max_valid_value¶
 - 
Maximum value valid when parsing input
 
- GimpUi.NumberPairEntry.props.min_valid_value¶
 - 
Minimum value valid when parsing input
 
- GimpUi.NumberPairEntry.props.ratio¶
 - 
The value as ratio
 
- GimpUi.NumberPairEntry.props.right_number¶
 - 
The right number
 
- GimpUi.NumberPairEntry.props.separators¶
 - Name:
 separators- Type:
 - Default Value:
 - Flags:
 
A string of valid separators