![]() |
![]() |
![]() |
GIMP Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
GimpRatioEntry; 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);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkEntry +----GimpRatioEntry
GimpRatioEntry implements AtkImplementorIface, GtkEditable and GtkCellEditable.
"denominator" gdouble : Read / Write "numerator" gdouble : Read / Write "ratio" gdouble : Read / Write
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
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. |