pdwidgets.widgets.card

Card container widget.

class pdwidgets.widgets.card.Card(parent, x=0, y=0, w=None, h=None, align=None, align_to=None, fg=None, bg=None, visible=True, value=None, padding=None, radius=8, shadow=2, title=None, font=None, style='flat', bg_hi=None, bg_lo=None, rim=None)[source]

Bases: Widget

Rounded container with optional title and drop shadow.

property style

Face style: "flat" or "raised".

draw(area=None)[source]

Draw the card’s shadow and rounded surface.

When a child asks the card to repaint just its sub-area (via parent.draw(child.area)), only that region is refilled with the card color so sibling widgets are not erased; a full (area is None) draw repaints the shadow and rounded surface.

Raised cards always repaint the full gradient face (partial solid fills would punch holes in the lighting).