fixed-width printf() output on an XmList on Solaris


 
Thread Tools Search this Thread
Top Forums Programming fixed-width printf() output on an XmList on Solaris
# 1  
Old 11-20-2002
Tools fixed-width printf() output on an XmList on Solaris

This one is a bit of bugger and I'm not sure if it's entirely relevant to this board but here goes...

I'm trying to produce some fixed width output to a List widget (X11/Motif GUI) So, I use something similar to:

sprintf(Buffer, "%*d%*f", 20, some_integer, 20, some_float);

This gives me a nice fixed-width string, which I then have to convert to an XmString and then add that to the List widget.

My problem is, after adding multiple lines, the columns are not aligned. On some machines they are (for instance if I remote shell from a Windows box using ReflectX), but on the host the output does not align.

Most of my widgets use the system default font, through which in Motif (as I understand it) you specify by using XmFONTLIST_DEFAULT_TAG in most of your XmString updates. I have a feeling that the font the host uses is not fixed-width - but I wouldn't have a clue where to change the font or what font it is using. Is it quite possible for X to use non fixed-width fonts?

Perhaps this is better targeted to a Motif forum, but thought it was worth a shot....

Thx in advance Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Joining fixed width files

Hi All, I need to join fixed width files on a column which is position 1 to 3 and need to have all the records from file1 file1.txt Cu1nullL1L2 Cu2nullL1L2 Cu3nullL1L2 file2.txt Cu1B1B2 Cu3B1B2 output.txt Cu1L1B1L2B2 Cu2L1L2 Cu3L1B1L2B3 I tried but not getting the expected... (12 Replies)
Discussion started by: shash
12 Replies

2. Shell Programming and Scripting

Alter Fixed Width File

Thank u so much .Its working fine as expected. ---------- Post updated at 03:41 PM ---------- Previous update was at 01:46 PM ---------- I need one more help. I have another file(fixed length) that will get negative value (ex:-00000000003000) in postion (98 - 112) then i have to... (6 Replies)
Discussion started by: vinus
6 Replies

3. Shell Programming and Scripting

Using printf (or other?) to create variable fixed width text

I would like to use printf (or something else?) to create a line of text that has varying column widths. This will be used to create a fixed width file (with varying column widths). For example, consider variables $1 $2 $3 are equal to a, b, c respectively and they should be printed in column... (10 Replies)
Discussion started by: farrenthorpe
10 Replies

4. UNIX for Dummies Questions & Answers

Length of a fixed width file

I have a fixed width file of length 53. when is try to get the lengh of the record of that file i get 2 different answers. awk '{print length;exit}' <File_name> The above code gives me length 50. wc -L <File_name> The above code gives me length 53. Please clarify on... (2 Replies)
Discussion started by: Amrutha24
2 Replies

5. Shell Programming and Scripting

variable fixed-width fields

Hi there, CTL Port IO Rate(IOPS) Read Rate(IOPS) Write Rate(IOPS) Read Hit(%) Write Hit(%) Trans. Rate(MB/S) Read Trans. Rate(MB/S) Write Trans. Rate(MB/S) 09:36:48 0 A 136 0 135 97 100 ... (6 Replies)
Discussion started by: gray380
6 Replies

6. Shell Programming and Scripting

Comparing two fixed width file

Hi Guys I am checking the treads to get the answer but i am not able to get the answer for my question. I have two files. First file is a pattern file and the second file is the file i want to search in it. Output will be the lines from file2. File1: P2797f12af 44751228... (10 Replies)
Discussion started by: anshul_er
10 Replies

7. Shell Programming and Scripting

Fixed-Width file from Oracle

Hi All, I have created a script which generates FIXED-WIDTH file by executing Oracle query. SELECT RPAD(NVL(col1,CHR(9)),20)||NVL(col2,CHR(9))||NVL(col3,CHR(9) FROM XYZ It generates the data file with proper alignment. But if same file i transfer to windows server or Mainframe... (5 Replies)
Discussion started by: Amit.Sagpariya
5 Replies

8. Shell Programming and Scripting

Printing Fixed Width Columns

Hi everyone, I have been working on a pretty laborious shellscript (with bash) the last couple weeks that parses my firewall policies (from a Juniper) for me and creates a nifty little columned output. It does so using awk on a line by line basis to pull out the appropriate pieces of each... (4 Replies)
Discussion started by: cixelsyd
4 Replies

9. UNIX Desktop Questions & Answers

Help with Fixed width File Parsing

I am trying to parse a Fixed width file with data as below. I am trying to assign column values from each record to variables. When I parse the data, the spaces in all coumns are dropped. I would like to retain the spaces as part of the dat stored in the variables. Any help is appreciated. I... (4 Replies)
Discussion started by: sate911
4 Replies

10. UNIX for Dummies Questions & Answers

Fixed Width file using AWK

I am using the following command at the Unix prompt to make my 'infile' into a fixed width file of 100 characters. awk '{printf "%-100s\n",$0}' infile > outfile However, there are some records with a special character "©" These records are using 3 characters in place of one and my record... (2 Replies)
Discussion started by: alok.benjwal
2 Replies
Login or Register to Ask a Question
XmList(3)							  LessTif Manuals							 XmList(3)

NAME
XmList - Motif-compatible list-box widget SYNOPSIS
#include <Xm/List.h> XmList XmCreateList DESCRIPTION
XmList X RESOURCES
Name Class Type Default Access ----------------------------------------------------------------------------------------------------- XmNlistSpacing XmCListSpacing VerticalDimension NULL CSG XmNlistMarginWidth XmCListMarginWidth HorizontalDimension NULL CSG XmNlistMarginHeight XmCListMarginHeight VerticalDimension NULL CSG XmNshadowThickness XmCShadowThickness HorizontalDimension NULL CSG XmNhighlightThickness XmCHighlightThickness HorizontalDimension NULL CSG XmNfontList XmCFontList FontList NULL CSG XmNstringDirection XmCStringDirection StringDirection NULL CSG XmNitems XmCItems XmStringTable NULL CSG XmNitemCount XmCItemCount Int 0 CSG XmNselectedItems XmCSelectedItems XmStringTable NULL CSG XmNselectedItemCount XmCSelectedItemCount Int 0 CSG XmNvisibleItemCount XmCVisibleItemCount Int 1 CSG XmNtopItemPosition XmCTopItemPosition TopItemPosition NULL CSG XmNselectionPolicy XmCSelectionPolicy SelectionPolicy NULL CSG XmNlistSizePolicy XmCListSizePolicy ListSizePolicy NULL CSG XmNscrollBarDisplayPolicy XmCScrollBarDisplayPolicy ScrollBarDisplayPolicy NULL CSG XmNautomaticSelection XmCAutomaticSelection Boolean NULL CSG XmNdoubleClickInterval XmCDoubleClickInterval Int -1 CSG XmNsingleSelectionCallback XmCCallback Callback NULL CSG XmNmultipleSelectionCallback XmCCallback Callback NULL CSG XmNextendedSelectionCallback XmCCallback Callback NULL CSG XmNbrowseSelectionCallback XmCCallback Callback NULL CSG XmNdefaultActionCallback XmCCallback Callback NULL CSG XmNhorizontalScrollBar XmCHorizontalScrollBar Widget NULL CSG XmNverticalScrollBar XmCVerticalScrollBar Widget NULL CSG XmNnavigationType XmCNavigationType NavigationType NULL CSG XmNlistSpacing XmNlistMarginWidth XmNlistMarginHeight XmNshadowThickness XmNhighlightThickness XmNfontList XmNstringDirection XmNitems XmNitemCount XmNselectedItems XmNselectedItemCount XmNvisibleItemCount XmNtopItemPosition XmNselectionPolicy XmNlistSizePolicy XmNscrollBarDisplayPolicy XmNautomaticSelection XmNdoubleClickInterval XmNsingleSelectionCallback XmNmultipleSelectionCallback XmNextendedSelectionCallback XmNbrowseSelectionCallback XmNdefaultActionCallback XmNhorizontalScrollBar XmNverticalScrollBar XmNnavigationType CLASS HIERARCHY
Object(3) Rect(3) UnNamedObj(3) Core(3) XmPrimitive(3) XmList(3) CALLBACKS
CONVENIENCE FUNCTIONS
SEE ALSO
LessTif Project April 1998 XmList(3)