runtime/webinterface.js
author Edouard Tisserant <edouard.tisserant@gmail.com>
Wed, 08 Mar 2023 23:18:41 +0100
branchwxPython4
changeset 3742 8c3d9159b6a9
parent 719 db54ccc96309
permissions -rw-r--r--
IDE: Fix missing highlighted element in diagrams when using GTK3

- wx's logical function does not work on gtk3, and highlighting relies on it
- skipping logical funciion at all "works" but this now makes highlight opaque
- no easy fix for highlight transparency since emulated with AND Wx logical function
+ added other highlight related cosmetic fix.
// import Nevow.Athena

function init() {
  Nevow.Athena.Widget.fromAthenaID(1).callRemote('HMIexec', 'HMIinitialisation');
}

WebInterface.PLC = Nevow.Athena.Widget.subclass('WebInterface.PLC');
WebInterface.PLC.method(
	 'updateHMI',
	 function (self, data) {
	   d = self.callRemote('getPLCElement');
	   d.addCallback(
			 function liveElementReceived(le) {
				d2 = self.addChildWidgetFromWidgetInfo(le);
				d2.addCallback(
						function childAdded(widget) {
						var node = self.nodeById('content');
						node.replaceChild(widget.node, node.getElementsByTagName('div')[0]);
						init();
						});
				});
	   });

Divmod.Base.addLoadEvent(init);