Display a custom properties as a checkbox in the ui?

hello, in this small example i just created 3 custom props, all 0 or 1, they will never be something else.
i just want them to be displayed as checkbox. any tricks to do that ?

Annotation%202019-09-15%20172201

import bpy

class Scatter_PT_test(bpy.types.Panel):
    bl_idname = "Scatter_PT_s"
    bl_label = "test"
    bl_category = "test"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_context = "objectmode"

    def draw(self, context):
        layout = self.layout
        A = bpy.context.object
        layout.prop(A,'["boolean"]',text='test')
        layout.prop(A,'["boolean1"]',text='test')
        layout.prop(A,'["boolean2"]',text='test')
        
def register():
    bpy.utils.register_class(Scatter_PT_test)

def unregister():
    bpy.utils.register_class(Scatter_PT_test)

if __name__ == "__main__":
    register()
    bpy.context.object["boolean"]=1
    bpy.context.object["boolean1"]=0
    bpy.context.object["boolean2"]=1

this could be really really useful for me. right now i just created an operator with an icon that show/hide if the boolean is off/on. too crappy but it work, but still crappy…

Annotation%202019-09-15%20172341

Hi,
you should take a look at this. It was a great help to me.

Hey Elreenys. thanks for your answer. :slight_smile:
But i already know all of this. this question is specific for an custom properties.

I test several options and only slider seems to work with custom properties. Why don’t you use directly the property of your particle system if it’s what you want to draw.
For example :
bpy.context.object.modifiers["ParticleSettings"].show_viewport = True

couldn’t work. i need a boolean value per particles system created.
i add thoses custom prop on creation and it’s really really handy.

so i need to work with custom properties like thoses.
Annotation%202019-09-16%20164309

my only proplem is that there’s no way to display them as checkboxes

I found this discussion maybe it will help you. https://blender.stackexchange.com/questions/35876/emulate-bool-custom-property