Skip to content

Commit

Permalink
?!
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippMDoerner committed Oct 7, 2023
1 parent 15d2d65 commit b922b8f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions owlkettle/adw.nim
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,19 @@ when AdwVersion >= (1, 4):

connectEvents:
proc changedCallback(widget: GtkWidget, data: ptr EventObj[proc (newValue: float)]) {.cdecl.} =
let newValue: float = parseFloat($gtk_editable_get_text(widget))
if not data[].widget.isNil():
SpinRowState(data[].widget).value = newValue
echo "Changed Signal"
var newValue: float
try:
let valueString = $gtk_editable_get_text(widget)
echo "The value: ", valueString
newValue = parseFloat(valueString)
except Exception as e:
echo "Borked: ", e.repr
newValue = 0.0

echo data.isNil
echo data[].widget.isNil
SpinRowState(data[].widget).value = newValue

data[].callback(newValue)
data[].redraw()
Expand Down

0 comments on commit b922b8f

Please sign in to comment.