Skip to content

Commit

Permalink
refactor: added procedures tclSetResult
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 666c5c028113f8173c6de67996efd0445809be4ab79fe8c8294e969d578ef569
  • Loading branch information
thindil committed Nov 16, 2023
1 parent 10b9e8e commit 830b176
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nim/src/tk.nim
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,17 @@ proc tclSetVar*(varName, newValue: string) =
## * varName - the name of the Tcl variable to set
## * newValue - the value of the Tcl variable
tclSetVar(getInterp(), varName.cstring, newValue.cstring, 1)

proc tclSetResult(interp: PInterp; result: cstring; freeProc: cint) {.cdecl,
dynlib: tclDllName, importc: "Tcl_SetResult".}
## Set the new value for the Tcl result
##
## * interp - the Tcl interpreter on which the result will be set
## * result - the new value for the Tcl result
## * freeProc - the type of procedure used to free the result

proc tclSetResult*(value: string) =
## Set the new value for the Tcl result on the current Tcl interpreter
##
## * result - the new value for the Tcl result
tclSetResult(getInterp(), value.cstring, 1)

0 comments on commit 830b176

Please sign in to comment.