Hi friendly folks!
I'm writing a small app for a friend in Gtk2(Glade3) and Perl to proccess new quotes for his company, as I have little experience in Gtk2 I've hit a pothole and now seek wisdom from you!
Right, so I have a textview in my gui, along with a bunch of text entries, someone inputs text into the entries, and with the click of a button they get added to the textview, the problem now is the formatting of the textview looks a bit moot, and I was wondering how to format the textview like a printf type, so that the spaces between the values looks better. An example:
# ID DESCRITPION QTY PRICE
1 los LABOUR ON PARTS 1 760.00
2 sa STRIP 1 450.00
3 av ANOTHER VALUE HERE 1 2000.00
The current code I use to insert the text into the textview is:
$buffer_1->insert($buffer_1->get_end_iter(),"$linenum
$kode\t$waarde\t\t\t\t$entry_qty\t\t\t\tR$entry_price\n");
That is sort off what it currently looks like in the textview (I simply seperated the values with tabs), I need everything to be inserted with the same ammount of spaces between, like:
# ID DESCRITPION QTY PRICE
1 los LABOUR ON PARTS 1 760.00
2 sa STRIP 1 450.00
3 av ANOTHER VALUE HERE 1 2000.00
Muhc like printf(%-33s....etc). Any help or tips would be greatly appreciated
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.