I really wish that PB GUI is using some built-in HTML renderer (eg Chrome, Webkit etc) for GUI. By this, we would be able to use HTML and CSS for any GUI layout inside of a Window. We simply may add some PB-Related identifier to access the elements like we do for Dialog library?
Code: Select all
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My test dialog</title>
<link rel="stylesheet" href="css/styles.css?v=1.0">
</head>
<body>
<script src="js/scripts.js"></script>
<input name="txtFirstname" type="text">
<input name="btnTest" type="button" value="OK">
</body>
</html>
Code: Select all
Html.i = LoadHTML(htmlString.s)
HtmlDialog.i = OpenHTMLDialog(#PB_Any, Html.i, HTMLTitle(HtmlDialog.i), 400, 400)
Gadget.i = HTMLGadget(HtmlDialog.i, "btnTest")
; and
BindGadgetEvent(Gadget.i, @ButtonCallback(), #PB_EventType_LeftClick)
Just dreaming...
(Yes, I know about the Node.js and other techniques some users already posted. But this is handicapped and complicated stuff. We need some real native implementation).
Of course, it is needed to provide some more functionality:
* Accessing and manipulating all elements in DOM (eg like jQuery using name or id)
** Example: SetHTML(HtmlDialog.i, "btnTest", "value", "okay") -> will set attribute "value" of button to be "okay"
** Example: Ret.s = GetHTML(HtmlDialog.i, "btnTest", "value") -> will return attribute "value" of button
* Allow calling PB functions from JS and get returned value (string, integer, float, bool)
** Example: Ret.s = CallHTML(HtmlDialog.i, "ScriptName", Params.s) -> Will call JS function "ScriptName"
* Allow calling JS functions incl. parameters from within a PB function (eg HTMLExecute("function", ParameterMap))
** Example: JS is calling PB_Call("PBFunctionName", Para1, ParaN) to call PB function
So, I never said it was easy, but really cool, huh?