How do I construct the right field_flags using the Enumerations table? #3316
-
Enumerations for Widgets: https://pymupdf.readthedocs.io/en/latest/vars.html#widget-flags-field-flags I'm a tiny bit confused on how to properly set the flags when I need a combination of things to happen. I'm not entirely sure what Seems like in some cases the values just need to be added together. So if I need a field to be required then I set the flag value to What if I need a field to be both required and multi-line, though? I tried adding all the values (in this case it would be I also get somewhat confused by the initial readout of the Any clarification on how to parse the flag values would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Ahhh, I realize now what the docs mean. Completely didn't register with me that That explains the initial flag value, |
Beta Was this translation helpful? Give feedback.
-
Ok! Turns out it's just as simple as adding together the two shifted values. So for this case Amazing what you can do when you understand what you're reading! |
Beta Was this translation helpful? Give feedback.
Ok! Turns out it's just as simple as adding together the two shifted values. So for this case
4096 + 2
, and that gets me a multi-line field that is required. I was getting turned around due to not realizing<<
was a python operator.Amazing what you can do when you understand what you're reading!