Add combobox values in different formats.
()
| 185 | |
| 186 | |
| 187 | def test_2411(): |
| 188 | """Add combobox values in different formats.""" |
| 189 | doc = pymupdf.open() |
| 190 | page = doc.new_page() |
| 191 | rect = pymupdf.Rect(100, 100, 300, 200) |
| 192 | |
| 193 | widget = pymupdf.Widget() |
| 194 | widget.field_flags = ( |
| 195 | pymupdf.PDF_CH_FIELD_IS_COMBO |
| 196 | | pymupdf.PDF_CH_FIELD_IS_EDIT |
| 197 | | pymupdf.PDF_CH_FIELD_IS_COMMIT_ON_SEL_CHANGE |
| 198 | ) |
| 199 | widget.field_name = "ComboBox-1" |
| 200 | widget.field_label = "an editable combo box ..." |
| 201 | widget.field_type = pymupdf.PDF_WIDGET_TYPE_COMBOBOX |
| 202 | widget.fill_color = pymupdf.pdfcolor["gold"] |
| 203 | widget.rect = rect |
| 204 | widget.choice_values = [ |
| 205 | ["Spain", "ES"], # double value as list |
| 206 | ("Italy", "I"), # double value as tuple |
| 207 | "Portugal", # single value |
| 208 | ] |
| 209 | page.add_widget(widget) |
| 210 | |
| 211 | |
| 212 | def test_2391(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…