Extended Objects
List
src.drawpyo.diagram.extended_objects.List
Bases: Object
Source code in src/drawpyo/diagram/extended_objects.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
list_items
property
writable
A Python list of strings of the objects in the list.
Returns:
Type | Description |
---|---|
list of strings: The list items |
width
property
writable
The width of the object. The difference between List's width and Object's width is that when the List.width is set all of the child objects will be set to the same width.
Returns:
Name | Type | Description |
---|---|---|
_type_ |
description |
__init__(title='List', list_items=[], **kwargs)
The List object wraps the basic Object type but allows easier managing of a list object and its members. All of the arguments and keyword arguments for Object are available here as well.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
str
|
The name in the heading of the list. Defaults to "List". |
'List'
|
list_items |
list of strings
|
A Python list of strings denoting the items. Defaults to empty. |
[]
|
Source code in src/drawpyo/diagram/extended_objects.py
7 8 9 10 11 12 13 14 15 16 17 18 |
|
add_item(item_text)
This function creates a new Draw.io text item and adds it to the end of the list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_text |
string
|
The name of the item to add. |
required |
Source code in src/drawpyo/diagram/extended_objects.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
autosize()
This function resizes the parent List object to match the length of the list of items. It also restacks the list items to fill any gaps from deleted items.
Source code in src/drawpyo/diagram/extended_objects.py
67 68 69 70 71 72 73 74 |
|
remove_item(item_text)
This function removes any list items matching the text passed into the function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_text |
string
|
The text of the list item to remove. |
required |
Source code in src/drawpyo/diagram/extended_objects.py
53 54 55 56 57 58 59 60 61 62 63 64 65 |
|