aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/ui_lib.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethereal/ui_lib.go')
-rw-r--r--ethereal/ui_lib.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/ethereal/ui_lib.go b/ethereal/ui_lib.go
index b7cabf3a8..f900fcaee 100644
--- a/ethereal/ui_lib.go
+++ b/ethereal/ui_lib.go
@@ -1,6 +1,7 @@
package main
import (
+ "fmt"
"path"
"github.com/ethereum/eth-go"
@@ -42,6 +43,15 @@ func (self *UiLib) EvalJavascriptFile(path string) {
self.jsEngine.LoadExtFile(path[7:])
}
+func (self *UiLib) EvalJavascriptString(str string) string {
+ value, err := self.jsEngine.Run(str)
+ if err != nil {
+ return err.Error()
+ }
+
+ return fmt.Sprintf("%v", value)
+}
+
func (ui *UiLib) OpenQml(path string) {
container := NewQmlApplication(path[7:], ui)
app := NewExtApplication(container, ui)