How to use Java class along with kivy widget

16 views
Skip to first unread message

Quadri Ganiu

unread,
Apr 19, 2018, 1:58:47 AM4/19/18
to Kivy users support
Please can some one show me how to use Java class or Widget along with kivy Widget class?

As in I want to make something like this
<code><pre>
from kivy.uix.widget import Widget
form jnius import autoclass

WebView = autoclass('android.webkit.WebView')


class MyWebView((WebView, Widget):
def __init__(self, **kwargs):
super(MyWebView, self).__init__(**kwargs)
#....

#bind WebView and Widget size
def on_size(self, size):
self.width = size[0]
self.height = size[1]


#bind WebView and Widget pos
def on_pos(self, pos):
self.width = pos[0]
self.height = pos[1]

</pre></code>

Please help I am new to programming.

Alexander Taylor

unread,
Apr 21, 2018, 8:00:26 AM4/21/18
to Kivy users support
You can't treat a java widget as a Kivy widget. I'm not that familiar with using java widgets using pyjnius, but you probably need to set their position and size via the java apis.

Quadri Ganiu

unread,
Apr 21, 2018, 5:30:55 PM4/21/18
to kivy-...@googlegroups.com
Thanks you

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages