954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

dialog box in C...

Hello All!

I am running AIX4.3 UNIX OS. I am developing using the C-Programming Language. I have inherited code which creates a dialog box.

dialog(box_height, box_width, position_x, position_y, "message")


The requirementnow, is to place a list of say numbers in the box and grow it
dynamically.

Problem is, when I attempt to print multiple strings of numbers with "newline" character, it
breaks up the integrity of the box. (..I have tried to voice this to my peers..)

Here is an example:

dialog(10,20,30,40,"Promise Form Shipments:==> "
                        "1111\n "
                        "2222\n" "
                        "3333\n "
                        "4444\n");


Yields this result:

+-------------------+
|Promise Form Shipme|
|nts:==> 1111
2222
3333
4444
| |
| |
+-------------------+

As opposed to this "single message" in quotes:

dialog(10,20,30,40,"Shipments:==> ");


Which yeilds this:

+-------------------+
|Shipments:==> |
| |
| |
+-------------------+(...the box is drawn correctly on the screen...)
Now, I think a couple of things are going on here.

1. I have never seen a dialog box in using C on a UNIX Platform
2. I think this is some type of NCURSES or other aftermarket implementation.
3. There is no mechanism to do this for multiple lines.
4. And of course, there is NO documentation on this dialog() function.

Can someone please give me some insight to this. As I mentioned previously, I do not think you can have multiple entries with this dialog() function. Your help is greatly appreciated!

kxh29
Junior Poster in Training
56 posts since Apr 2007
Reputation Points: 10
Solved Threads: 1
 

I don't see why someone couldn't write a function named dialog() for *nix -- it obviously is not the same as a MS-Windows DialogBox. Do you have to source code for that function? If not then your only recourse is to read the documentation, and you say there is none. If you are using some sort of GUI libraries such as QT then you will find the documentation at their web site.

>>I think this is some type of NCURSES or other aftermarket implementation.
Well, what are the libraries that your program has to link with? Those should tell you where the function is.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You