Opened 8 years ago
Closed 8 years ago
#735 closed enhancement (fixed)
Need access to Python from Javascript in HTML pages
Reported by: | Conrad Huang | Owned by: | Conrad Huang |
---|---|---|---|
Priority: | blocker | Milestone: | 0.5 |
Component: | Help System | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
Using HTML pages as UI for tools may sometimes require access to ChimeraX state from the HTML page. For example, the toolshed app page should display "Install" for uninstalled bundles, "Update" if the installed bundle is older, or "Reinstall" if the installed bundle is the same as the latest.
A possible way to do this is QWebChannel. See attached files for example of how it can be implemented. For each chimerax.core.ui.widgets.htmlview.ChimeraXHtmlView instance, we can create a web channel with which custom QObject instances may be registered. Once registered, the custom QObject can be referenced from Javascript using the same API. We also need to define a *class* method to register objects since we frequently want access to the same functionality in different viewers. If we keep a weakref list of created ChimeraXHtmlView instances, the class method can register objects with all of them.
Attachments (2)
Change History (5)
by , 8 years ago
by , 8 years ago
comment:1 by , 8 years ago
Owner: | set to |
---|---|
Status: | new → accepted |
comment:2 by , 8 years ago
Milestone: | Beta Release → 0.5 |
---|
Milestone renamed