Checklist with Kivy

33 views
Skip to first unread message

M H

unread,
Aug 19, 2025, 10:34:29 AMAug 19
to Kivy users support
Greetings. I've tried, for months, to figure out how to make a simple checklist app with Kivy that is similar to the notes app on most smartphones. Unfortunately I've been unable to find a way to add the checkbox feature to a Text Input widget. Am I chasing my tail here or is there actually a way to accomplish this? And can any other widget be incorporated into the Text Input widget?

ElliotG

unread,
Aug 19, 2025, 11:04:44 AMAug 19
to Kivy users support
In general you do not put one widget into another widget.  Layouts are specialized widgets for positioning and sizing their child widgets, widgets get put into layouts.

So getting to your question, if you want to create a widget that has a Checkbox and a Textinput here are some alternatives.
Use a Boxlayout and position the two widgets next to each other.  This will give you the two widgets side by side.  This is the simplest way to do it - but does not look like the checkbox is in the TextInput.

If you want it to look like the checkbox is in the TextInput, you need to manipulate the image associated with the TextInput.  A TextInput has 4 images associated with it.  Look at the docs for background_normal and background_active.  You can see there is a default image.  To create a the desired effect try the following:
Create a BoxLayout, use the canvas to render the image of a TextInput, use BorderImage.  Under the BoxLayout add the Checkbox and TextInput.  Be sure to remove the image from the TextInput.  Use the on_focus event of the TextInput to select the image associated with the BoxLayout.

Another alternative would be to use KivyMD.  KivyMD is a set of widgets for Kivy that are compliant with Googles Material Design Spec.  The TextField widget has these kinds of capabilities using icons.

Decide on the path you want, share your code if you get stuck.  Good Luck!

M H

unread,
Aug 21, 2025, 9:01:31 AMAug 21
to kivy-...@googlegroups.com
Kivy MD does indeed sound like the safer and more convenient option for me. Thanks for your help.

--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/QLnolmgUAx4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/c32e1be6-6413-488f-a0f1-c3cbf51736f2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages