BindedInputNumber
Introduction
BindedInputNumber
widget in Supervisely is a user interface element that allows users to input two numerical values and customize their behavior using the proportional, min, and max properties. With the BindedInputNumber widget, users can fine-tune specific parameters within supervisely apps that require two numerical inputs, such as defining a rectangular region of interest by specifying the x
and y
coordinates and the width
and height
. The BindedInputNumber
widget provides a convenient and flexible way to input and manage these values, with customizable behavior to ensure accurate and precise inputs.
Function signature
Parameters
width
int
Width value
height
int
Weight value
min
int
Minimum allowed value
max
int
Maximum allowed value
proportional
bool
Synchronize changes in width and height parameters
widget_id
str
ID of the widget
width
Determine width value.
type: int
default value: 256
height
Determine height value.
type: int
default value: 256
min
Minimum allowed value.
type: int
default value: 1
max
Maximum allowed value.
type: int
default value: 10000
proportional
Synchronize changes in width and height parameters.
type: bool
default value: false
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
value(width: int, height: int)
Set widgets width
and height
filed.
get_value()
Get input width
and height
values.
proportional(value: bool)
Set proportional
value.
min(value: int)
Set min
value.
max(value: int)
Set max
value.
disable()
Disable widget.
enable()
Enable widget.
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/input/004_binded_input_number/src/main.py
Import libraries
Initialize BindedInputNumber
widget
BindedInputNumber
widgetCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create app using layout
Create an app object with layout parameter.
Last updated