Skip to content

Commit

Permalink
add extra bind procs with no e param
Browse files Browse the repository at this point in the history
  • Loading branch information
neroist committed Jul 19, 2024
1 parent 1a913af commit 307814e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions webui.nim
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,17 @@ proc `bind`*(window: Window; element: string; `func`: proc (e: Event)) =

cbs[wid][bid] = `func`

proc `bind`*(window: Window; element: string; `func`: proc ()) =
window.bind(element, proc (e: Event) = `func`())
proc `bind`*(window: Window; element: string; `func`: proc (): string) =
window.bind(element, proc (e: Event) = e.returnString(`func`()))
proc `bind`*(window: Window; element: string; `func`: proc (): int) =
window.bind(element, proc (e: Event) = e.returnInt(`func`()))
proc `bind`*(window: Window; element: string; `func`: proc (): float) =
window.bind(element, proc (e: Event) = e.returnFloat(`func`()))
proc `bind`*(window: Window; element: string; `func`: proc (): bool) =
window.bind(element, proc (e: Event) = e.returnBool(`func`()))

proc `bind`*(window: Window; element: string; `func`: proc (e: Event): string) =
window.bind(
element,
Expand Down

0 comments on commit 307814e

Please sign in to comment.