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
XmCreateScrolledList(library call)										XmCreateScrolledList(library call)

NAME
XmCreateScrolledList -- The List ScrolledList convenience creation function SYNOPSIS
#include <Xm/List.h> Widget XmCreateScrolledList( Widget parent, String name, ArgList arglist, Cardinal argcount); DESCRIPTION
XmCreateScrolledList creates an instance of a List widget that is contained within a ScrolledWindow. The ScrolledWindow parent is created managed. All ScrolledWindow subarea widgets are automatically created by this function. The ID returned by this function is that of the List widget (not the ScrolledWindow widget). Use this widget ID for all operations on the List widget. Use the widget ID of the List wid- get's parent for all operations on the ScrolledWindow. To obtain the ID of the ScrolledWindow widget associated with the List widget, use the Xt Intrinsics XtParent function. The name of the ScrolledWindow created by this function is formed by concatenating SW onto the end of the name specified in the parameter list. All arguments to either the List or the ScrolledWindow widget can be specified at creation time using this function. Changes to initial position and size are sent only to the ScrolledWindow widget. Other resources are sent to the List or the ScrolledWindow widget as appro- priate. Note that the result of providing the XmNdestroyCallback resource in the creation arglist is unspecified. The application should use the XtAddCallback function to add callbacks to the appropriate widget (List or ScrolledWindow) after creating it. This function forces the following initial values for ScrolledWindow resources: o XmNscrollingPolicy is set to XmAPPLICATION_DEFINED. o XmNvisualPolicy is set to XmVARIABLE. o XmNscrollBarDisplayPolicy is set to XmSTATIC. (No initial value is forced for the List's XmNscrollBarDisplayPolicy.) o XmNshadowThickness is set to 0 (zero). parent Specifies the parent widget ID name Specifies the name of the created widget arglist Specifies the argument list argcount Specifies the number of attribute/value pairs in the argument list (arglist) For a complete definition of List and its associated resources, see XmList(3). RETURN
Returns the List widget ID. RELATED
XmList(3) and XmScrolledWindow(3). XmCreateScrolledList(library call)