1

I am trying to embed a browser using cefpython3 within my kivy application - I don't need a ton of functionality (I just need the browser to run some javascript for me).

I downloaded the cefpython3 repo and got the hello_world.py to work, and now I am simply trying to get that window that pops up into a kivy widget.

The examples seem pretty dated and people are saying that they only developed in certain environments - what would I have to do/learn to make a widget and drop this browser in there?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Fernando
  • 109
  • 1
  • 8
  • See the official example: https://github.com/cztomczak/cefpython/blob/master/src/linux/binaries_64bit/kivy_.py – eyllanesc Apr 13 '21 at 00:07
  • Yes, I have tried that but with no luck, the program will say it cannot find _event.pyx in kivy, among other challenges / errors – Fernando Apr 13 '21 at 00:20
  • It is also only tested on linux, while my operating platform is windows. If I can build the widget from scratch and embed what I need to, that will help me farther i believe – Fernando Apr 13 '21 at 00:21
  • 1
    change `self.browser_widget = CefBrowser(id="browser")` to `self.browser_widget = CefBrowser()` – eyllanesc Apr 13 '21 at 00:24
  • 1) You will be the first to test it on windows, 2) but I doubt that you will be the first since according to the `elif sys.platform == 'darwin' or sys.platform == 'win32':` command I see that they have thought about windows 3) I think it should work since the logic is simple: get the cef buffer and only using a texture for painting in kivy. – eyllanesc Apr 13 '21 at 00:26
  • I'm genuinely shocked - i spent a few hours last night but it worked. Why would removing `id="browser"` change so much/fix my issue? – Fernando Apr 13 '21 at 00:35
  • It is that kivy uses the kwargs to handle the bindings (events) but the event or property "id" does not exist, so it throws that error. Recommendation: report that bug to cefpython – eyllanesc Apr 13 '21 at 00:37

0 Answers0