Resizable
A container in which only one View
can be placed and interactively resized by dragging the content View
around
Create from source
func NewResizable(session Session, params Params) Resizable
Create new resizable object and returns its interface
Create from resource
Resizable {
id = resizable,
content = EditView{
id = editView,
hint = "hint text",
},
}
Interface description
Inherit methods, properties and events from ParentView
, View
Properties
"content"
Content view to make it resizable or text in this case TextView
will be created
Constant: Content
Types: View
, string
Internal type is View
, other types converted to it during assignment
Examples
Resizable {
width = 50%,
height = 50%,
content = EditView {
background-color = skyblue,
edit-view-type = multiline,
text = "Some text",
}
}
resizable := rui.NewResizable(session, rui.Params{
rui.Width: rui.Percent(50),
rui.Height: rui.Percent(50),
rui.Content: rui.NewEditView(session, rui.Params{
rui.BackgroundColor: rui.SkyBlue,
rui.EditViewType: rui.MultiLineText,
rui.Text: "Some text",
}),
})
"resize-border-width"
Specifies the width of the resizing border
Constant: ResizeBorderWidth
Types: SizeUnit
, SizeFunc
, string
, float
, int
Internal type is SizeUnit
, other types converted to it during assignment
See SizeUnit
description for more details
Examples
Resizable {
width = 50%,
height = 50%,
background-color = lightgray,
resize-border-width = 0.5em,
content = View {
background-color = skyblue,
},
}
resizable := rui.NewResizable(session, rui.Params{
rui.Width: rui.Percent(50),
rui.Height: rui.Percent(50),
rui.BackgroundColor: rui.LightGray,
rui.ResizeBorderWidth: rui.Em(0.5),
rui.Content: rui.NewView(session, rui.Params{
rui.BackgroundColor: rui.SkyBlue,
}),
})
"side"
Determines which side of the container is used to resize. The value of property is an or-combination of values listed. Default value is "all"
Constant: Side
Types: int
, string
Values
int | string | Description |
---|---|---|
1 (TopSide ) |
"top" | Top frame side |
2 (RightSide ) |
"right" | Right frame side |
4 (BottomSide ) |
"bottom" | Bottom frame side |
8 (LeftSide ) |
"left" | Left frame side |
15 (AllSides ) |
"all" | All frame sides |