If the plan is for a person to use a GUI to edit binary data, I think it would be better for the widget to be displaying some consistent projection of the data into visible characters, rather than pumping the raw binary data directly to the widget.
For example, you could display the byte stream as a space-separated sequence of two-digit hex numbers (or three-digit octal or even decimal); or a combination of visible ASCII characters plus "escape" or "control" strings like "\n" or "^J"; or maybe use a font that combines "normal" ASCII characters with those nifty two-letter abbreviations for control codes -- Zaxo showed a cool trick using Unicode for this: Printing the Unprintable (but as indicated in that thread, there might not be displayable glyphs for all possible byte values).
I'm also curious what sort of technique you provide for keyboarding arbitrary binary values (when the user needs to add or change a byte value). Obviously, if you display just space-separated numerics (hex, octal or decimal), the user could just type in digits; or if you're showing things like "^J", accept strings like that for input. You could even offer the users a choice of display/keyboarding methods.
The main point, though, is that you should have some sort of transform between the binary data in a file and the displayable/editable data in the GUI -- not only to make sure that everything can be seen and typed in, but also to eliminate any possible ambiguities in the display (e.g. space vs. tab vs. LF vs CRLF).
In reply to Re^3: Displaying NUL in a TK::Text widget
by graff
in thread Displaying NUL in a TK::Text widget
by thor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |