Skip to content

Commit

Permalink
can-lehmann#83 Fix semantics on marks
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippMDoerner committed Sep 29, 2023
1 parent 227ad05 commit 80d8b69
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions owlkettle/widgets.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3459,10 +3459,9 @@ renderable Scale of BaseWidget:
state.value = state.internalWidget.gtk_range_get_value().float64

hooks marks:
(build, update):
state.internalWidget.gtk_scale_clear_marks()
let hasScaleMarks = widget.hasMarks and widget.valMarks.len > 0
if hasScaleMarks:
property:
if widget.hasMarks:
state.internalWidget.gtk_scale_clear_marks()
for mark in widget.valMarks:
let label: string = if mark.label.isSome(): mark.label.get() else: $mark.value
gtk_scale_add_mark(state.internalWidget, mark.value , mark.position.toGtk(), label.cstring)
Expand Down

0 comments on commit 80d8b69

Please sign in to comment.