moguri / cefpanda Goto Github PK
View Code? Open in Web Editor NEWPython module for using CEFPython with Panda3D
License: MIT License
Python module for using CEFPython with Panda3D
License: MIT License
The current version of "exec_js_func" reads:
def exec_js_func(self, js_func, *args, onload=True):
if onload and not self._is_loaded:
self._js_func_onload_queue.append((js_func, args))
else:
self.browser.GetMainFrame().ExecuteJavascript(js_func, *args)
Unless I misunderstand how it is intended to work, the last line should probably read...
self.browser.GetMainFrame().ExecuteFunction(js_func, *args)
... instead. Either way, "exec_js_func" currently does not behave as expected.
As the title says: if one resizes the Panda3D window horizontally, the CEF browser simply stretches along instead of re-sizing to the new resolution.
I've currently fixed this by changing...
if self._cef_texture.get_x_size() != width AND self._cef_texture.get_y_size() != height:
to
if self._cef_texture.get_x_size() != width OR self._cef_texture.get_y_size() != height:
... in CEFPanda._set_browser_size
, on my local version of cefpanda.
I considered posting this as a pull request, but since I don't know for sure how you intended that method to operate, I'll leave it to you.
.load_file() seems to take only take paths relative to the working directory. That forces running them from the source directory. Paths should (also) be relative to the module source file that makes the call, or the module directory.
I tried running the examples (using the pip release of cefpanda) on macOS 10.15 and I am getting the error "Illegal instruction: 4". I made a minimal script with just cefpython and panda3d and found the following weirdness:
If you initialize cefpython before panda3d, then panda3d only gets mouse move events when the mouse buttons are held down. If you initialize cefpython after panda3d, then you get the illegal instruction error when running cefpanda.MessageLoopWork()
.
Here's the minimal example with cefpython being initialized before panda3d:
from cefpython3 import cefpython
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
class MyApp(ShowBase):
def __init__(self):
super().__init__()
self.disableMouse()
self.updateTask = self.taskMgr.add(self.updateTask, 'updateTask')
def updateTask(self, task):
if self.mouseWatcherNode.hasMouse():
x = self.mouseWatcherNode.getMouseX()
y = self.mouseWatcherNode.getMouseY()
print(self.mouseWatcherNode, x, y)
cefpython.MessageLoopWork()
return Task.cont
def main():
settings = {
"windowless_rendering_enabled": True,
}
switches = {
"disable-gpu": "",
"disable-gpu-compositing": "",
"enable-begin-frame-scheduling": "",
}
cefpython.Initialize(settings=settings, switches=switches)
app = MyApp()
app.run()
cefpython.Shutdown()
if __name__ == '__main__':
main()
Hi,
First, thank you for this project, it is fun and easy to use!
Second, I am trying to implement buttons with a special effect on :hover and :active. The :hover works fine, but :active does not work. I was wondering if it was technically possible and if you are interested, I could try forking and sending a pull request.
Tried this because of the mention in
https://discourse.panda3d.org/t/developers-favorite-gui-framework/24207/35
relating to panda3d/panda3d#317
It would be helpful if there were a readme file that contained information about how to install cefpanda, and contained some basic documentation or links to the example code.
When building a drop-down menu with the "select" and "option" HTML tags, I'm having a severe delay in the options being displayed when I click on it. The shape of the options appear after a moment, but as a transparent/grey rectangle, and sometimes don't stay that way, or take another moment to fill in properly.
Here's a file reproducing the issue on my system:
BUGREPORT_cefpanda_select_does_not_display_properly.zip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.