gtk_numericalEntryWidget

gtk_numericalEntryWidget — Defines a widget to enter numerical values without any boundary or precision constrains.

Functions

Properties

gdouble value Read / Write / Construct

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkEntry
                ╰── VisuUiNumericalEntry

Implemented Interfaces

VisuUiNumericalEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.

Description

This widget is based on the GtkEntry widget but behaves more like a GtkSpinButton is fact. It is designed to enter numerical values, but without any boundary or precision constrains. One can use either plain or scientific notations.

Functions

visu_ui_numerical_entry_new ()

GtkWidget *
visu_ui_numerical_entry_new (double value);

A VisuUiNumericalEntry widget is like a GtkEntry widget, but it only accepts double precision values (written in plain format, e.g. 1.23456, or scientific notation, e.g. 1.2345e6). The widget can't be blank and there is always a value printed in it. If the user erase the current value or enter something that is not a recognised double precision value, the widget returns to its previous valid value.

Parameters

value

the initial value.

 

Returns

a newly created VisuUiNumericalEntry widget.


visu_ui_numerical_entry_setValue ()

void
visu_ui_numerical_entry_setValue (VisuUiNumericalEntry *numericalEntry,
                                  double value);

Use this method to set the value for the given numericalEntry widget.

Parameters

numericalEntry

a VisuUiNumericalEntry widget ;

 

value

a double precision value.

 

visu_ui_numerical_entry_getValue ()

double
visu_ui_numerical_entry_getValue (VisuUiNumericalEntry *numericalEntry);

You can get the value contained in the given numericalEntry using this method.

Parameters

numericalEntry

a VisuUiNumericalEntry widget.

 

Returns

the double precision value printed in the VisuUiNumericalEntry.


visu_ui_numerical_entry_warnValue ()

void
visu_ui_numerical_entry_warnValue (VisuUiNumericalEntry *numericalEntry,
                                   float fallback);

Display a warning sign in the entry and fallback to the given value.

Parameters

numericalEntry

a VisuUiNumericalEntry object.

 

fallback

a floating point value.

 

Since: 3.8

Types and Values

VisuUiNumericalEntry

typedef struct _VisuUiNumericalEntry VisuUiNumericalEntry;

Short form for a VisuUiNumericalEntry_struct structure.


VisuUiNumericalEntryClass

typedef struct _VisuUiNumericalEntryClass VisuUiNumericalEntryClass;

Opaque structure.

Property Details

The “value” property

  “value”                    gdouble

numerical value.

Flags: Read / Write / Construct

Allowed values: [-G_MAXFLOAT,G_MAXFLOAT]

Default value: 0

Signal Details

The “value-changed” signal

void
user_function (VisuUiNumericalEntry *entry,
               gdouble               oldValue,
               gpointer              user_data)

This signal is emitted when a new valid numerical value is entered.

Parameters

entry

the VisuUiNumericalEntry that emits the signal ;

 

oldValue

the previous value.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action

Since: 3.1