Datatables checkboxe's and list doesn't press on windows

5 views
Skip to first unread message

Francisco Ponce

unread,
Aug 25, 2023, 9:45:07 AM8/25/23
to KivyMD users support
Hi everyone

I just created a datatable but the checkbox doesn't work, only works when I put a right click on the screen. (gif for reference)

As you see it doesnt scroll neither it presses the checkbox,
but when I press a right click on screen (red dot) it works....

Same happens with pressing list icon...

Questions:
1. Does the same happens to you?
2. If so, what could be changed so that it works without the red dot?
3. If not, why could that be happening on my device?

Env Requirements:

kivymd==1.1.1
Kivy==2.2.0
numpy==1.25.1
pandas==2.0.3
pillow==9.4.0
openpyxl==3.1.2
ffpyplayer==4.5.0

Code (also as a .py file on attachments)

from kivymd.app import MDApp
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen
from kivymd.uix.datatables import MDDataTable
from kivy.metrics import dp


screen_helper = """
BibliotecaScreen:
name: "bibliotecascreen"
MDBoxLayout:
orientation: 'vertical'
MDBoxLayout:
MDScrollView:
id: mdscrollviewlibrary

"""

class BibliotecaScreen(Screen):
def __init__(self, **kwargs):
super().__init__(**kwargs)
tabla = MDDataTable(size_hint=(0.9,0.6),
pos_hint={'center_x':0.5,'center_y':0.5},
check=True,
rows_num=10,
column_data=[
("Food", dp(30)),
("Calories", dp(30)),],
row_data=[
("Burger","300"),
("bla","50"),
("bla", "50"),
("bla", "50"),
("bla", "50"),
])
self.add_widget(tabla)
tabla.bind(on_check_press=self.check_press)
tabla.bind(on_row_press=self.row_press)

def check_press(self,instance_table,current_row):
print(instance_table,current_row)


def row_press(self,instance_table,instance_row):
print(instance_table,instance_row)




class MainApp(MDApp):
def build(self):
kv = Builder.load_string(screen_helper)
return kv

if __name__ == '__main__':
from kivy.core.window import Window
Window.size = (400, 500)
MainApp().run()
datatable-only-4.py
Animation3.gif
Reply all
Reply to author
Forward
0 new messages