![]() |
![]() |
![]() |
GIMP Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
GimpRatioEntry; enum GimpAspectType; GtkWidget* gimp_ratio_entry_new (void); void gimp_ratio_entry_set_fraction (GimpRatioEntry *entry, gdouble numerator, gdouble denominator); void gimp_ratio_entry_get_fraction (GimpRatioEntry *entry, gdouble *numerator, gdouble *denominator); void gimp_ratio_entry_set_ratio (GimpRatioEntry *entry, gdouble ratio); gdouble gimp_ratio_entry_get_ratio (GimpRatioEntry *entry); void gimp_ratio_entry_set_aspect (GimpRatioEntry *entry, GimpAspectType aspect); GimpAspectType gimp_ratio_entry_get_aspect (GimpRatioEntry *entry);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkEntry +----GimpRatioEntry
GimpRatioEntry implements AtkImplementorIface, GtkEditable and GtkCellEditable.
"aspect" GimpAspectType : Read / Write "denominator" gdouble : Read / Write "numerator" gdouble : Read / Write "ratio" gdouble : Read / Write
"ratio-changed" void user_function (GimpRatioEntry *gimpratioentry, gpointer user_data) : Run first
typedef enum { GIMP_ASPECT_SQUARE, /*< desc="Square" >*/ GIMP_ASPECT_PORTRAIT, /*< desc="Portrait" >*/ GIMP_ASPECT_LANDSCAPE /*< desc="Landscape" >*/ } GimpAspectType;
GtkWidget* gimp_ratio_entry_new (void);
Returns : | a new GimpRatioEntry widget |
Since GIMP 2.4
void gimp_ratio_entry_set_fraction (GimpRatioEntry *entry, gdouble numerator, gdouble denominator);
Sets the fraction displayed by a GimpRatioEntry. If the resulting ratio is different to the previously set ratio, the "ratio-changed" signal is emitted.
If the denominator is zero, the GimpRatioEntry will silently convert it to 1.0.
entry : |
a GimpRatioEntry widget |
numerator : |
numerator of the fraction to set in the widget |
denominator : |
denominator of the fraction to set in the widget |
Since GIMP 2.4
void gimp_ratio_entry_get_fraction (GimpRatioEntry *entry, gdouble *numerator, gdouble *denominator);
Gets the fraction displayed by a GimpRatioEntry.
The denominator may be zero if the GimpRatioEntry shows just a single value. You can use gimp_ratio_entry_get_ratio to retrieve the ratio as a single decimal value.
entry : |
a GimpRatioEntry widget |
numerator : |
pointer to store the numerator of the fraction |
denominator : |
pointer to store the denominator of the fraction |
Since GIMP 2.4
void gimp_ratio_entry_set_ratio (GimpRatioEntry *entry, gdouble ratio);
Sets the ratio displayed by a GimpRatioEntry. 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 numerator and denominator < 1000.
entry : |
a GimpRatioEntry widget |
ratio : |
ratio to set in the widget |
Since GIMP 2.4
gdouble gimp_ratio_entry_get_ratio (GimpRatioEntry *entry);
Retrieves the ratio value displayed by a GimpRatioEntry.
entry : |
a GimpRatioEntry widget |
Returns : | The ratio value. |
Since GIMP 2.4
void gimp_ratio_entry_set_aspect (GimpRatioEntry *entry, GimpAspectType aspect);
Sets the aspect of the ratio by swapping the numerator and denominator
(or setting them to 1.0 in case that aspect
is GIMP_ASPECT_SQUARE
).
entry : |
a GimpRatioEntry widget |
aspect : |
the new aspect |
Since GIMP 2.4
GimpAspectType gimp_ratio_entry_get_aspect (GimpRatioEntry *entry);
Gets the aspect of the ratio displayed by a GimpRatioEntry.
entry : |
a GimpRatioEntry widget |
Returns : | The entry's current aspect. |
Since GIMP 2.4
denominator
" property"denominator" gdouble : Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 1
numerator
" property"numerator" gdouble : Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 1
void user_function (GimpRatioEntry *gimpratioentry, gpointer user_data) : Run first
gimpratioentry : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |