()
| 76 | |
| 77 | |
| 78 | def test_listbox(): |
| 79 | doc = pymupdf.open() |
| 80 | page = doc.new_page() |
| 81 | widget = pymupdf.Widget() |
| 82 | widget.field_name = "ListBox-1" |
| 83 | widget.field_label = "is not a drop down: scroll with cursor in field" |
| 84 | widget.field_type = pymupdf.PDF_WIDGET_TYPE_LISTBOX |
| 85 | widget.field_flags = pymupdf.PDF_CH_FIELD_IS_COMMIT_ON_SEL_CHANGE |
| 86 | widget.fill_color = gold |
| 87 | widget.choice_values = ( |
| 88 | "Frankfurt", |
| 89 | "Hamburg", |
| 90 | "Stuttgart", |
| 91 | "Hannover", |
| 92 | "Berlin", |
| 93 | "München", |
| 94 | "Köln", |
| 95 | "Potsdam", |
| 96 | ) |
| 97 | widget.rect = rect |
| 98 | widget.text_color = blue |
| 99 | widget.text_fontsize = fontsize |
| 100 | widget.field_value = widget.choice_values[-1] |
| 101 | print("About to add '%s'" % widget.field_name) |
| 102 | page.add_widget(widget) # create the field |
| 103 | field = page.first_widget |
| 104 | assert field.field_type_string == "ListBox" |
| 105 | |
| 106 | |
| 107 | def test_combobox(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…