Do you know where your variables are? | |
PerlMonks |
TK listbox escape textby jbuck (Novice) |
on Jun 26, 2015 at 05:29 UTC ( [id://1132062]=perlquestion: print w/replies, xml ) | Need Help?? |
jbuck has asked for the wisdom of the Perl Monks concerning the following question: Hello monks, This seemingly simple problem frustrated me enough to sign up as a new user just to ask your opinions! I am no stranger to perl, but am a beginner incorporating TK into my scripts... My problem is that I have a TK listbox which I am using to display search results of a database. The catch is that each result contains a "short title" and a "description", each of varying lengths. I want each line in the listbox to display the short title followed by the description. I can easily do this with various forms of concatenation, however the differing character lengths make for a "jagged" and ugly listing. The obvious answer would be to use a tab (\t) in between, but the listbox doesn't seem to recognize escape sequences and instead displays their regex (xism?) equivalent?? I have looked everywhere for some listbox-specific tab, but as it doesn't use TK::text as a base I don't think it supports insertTab()? I don't see this problem when using ROText. EXAMPLE: displays (literally): What is the "\x{9}"?? How do I use escape sequences / regex with listbox?? Thanks!! Thanks for the input folks. sprintf was a good idea, but no luck; it still printed the \x{9} equivalent. I had briefly read about HList, but didn't want to go through the trouble of changing the widget. I think I'll try that now. Until then, I have temporarily kludged it for our users haha:
Back to
Seekers of Perl Wisdom
|
|