how to set AlignStart for Box and Entry widgets? #45
-
In the My reading of the owlkettle docs says i can set AlignStart for both the box and the property's Entry, but i'm not sure how. I haven't run across an example yet, and i've tried every unholy abomination i can think of, to no avail. :) Any tips appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
The entries in Box:
orient = OrientY
margin = 12
spacing = 6
Box {.expand: false.}:
orient = OrientX
spacing = 6
Label:
text = "Some Entry"
xAlign = 0
Entry() {.expand: false.}
Box {.expand: false.}:
orient = OrientX
spacing = 6
Label:
text = "Entry 2"
xAlign = 0
Entry() {.expand: false.} You could set the entries to This is probably not what you want though. To me this problem seems like a classic use case for a Grid:
margin = 12
spacing = 6
Label {.x: 0, y: 0.}:
text = "Some Entry"
xAlign = 0
Entry() {.x: 1, y: 0, hExpand: true.}
Label {.x: 0, y: 1.}:
text = "Entry 2"
xAlign = 0
Entry() {.x: 1, y: 1, hExpand: true.} The result now looks like this: Here it is applied to a case similar to your example, where one entry is wider than the other: Grid:
margin = 12
spacing = 6
Label {.x: 0, y: 0, hExpand: true.}:
text = "Some Entry"
xAlign = 0
Entry(width=50) {.x: 1, y: 0.}
Label {.x: 0, y: 1, hExpand: true.}:
text = "Entry 2"
xAlign = 0
Entry() {.x: 1, y: 1.} If you use this in a larger application, note that you might want to abstract this usage of |
Beta Was this translation helpful? Give feedback.
The entries in
custom_dialog
are right aligned because the labels are set toexpand: true
, while the entries useexpand: false
. This causes the labels to take up any remaining space in the rows.You could set the entries to
expand: true
instead, while usingexpand: false
for the labels. This will cause the entries to dynamicall…