need info on current curser postion.


 
Thread Tools Search this Thread
Top Forums Programming need info on current curser postion.
# 1  
Old 07-11-2008
need info on current curser postion.

Hi All,

I have written the below code to know the current curser position. The problem with this code is - it gives me window size properly but whn it comes to current curser position then it gives (0,0) as x,y co-ordinate eventhough my curser is somewhere middle on command line interface.

So could you please tell me that whats the purpose of getyx(). If it is to know current curser position then why does it always give me 0,0 as x,y co-ordinate?
////////////////////////////////////////////////////
initscr();
getmaxyx(stdscr, row, col);
getyx(stdscr, y, x);
endwin();
////////////////////////////////////////////////////

Thanks in advance
Swapnil
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print column postion

Hi, I am using the below code for printing the column position of a particular string nawk -v srch="DName" -F '\t' '{for(j=1; j<=NF; j++) { if($j==srch) print j } exit }' input_file.txt The above code prints the column position of the input string DName (that is 1) Now the problem is,... (7 Replies)
Discussion started by: sampoorna
7 Replies

2. Shell Programming and Scripting

Ssh = ssh expect and keep everything not change include parameter postion

I have write a script which contains ssh -p 12345 dcplatform@10.125.42.50 ssh 127.0.0.1 -p 5555 "$CMD" ssh root@$GUEST_IP "$CMD" before I use public key, it works well, now I want to change to "expect", BUT I don't want to change above code and "parameter position" I can post a... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

3. UNIX for Dummies Questions & Answers

how to get index/postion of a string?

Hi, I have a string like the following: /db1/data/GLIDER/SYSTEM.dbf need to find the postion where "SYSTEM.dbf" starts, so I tried: LOCATION=/db1/data/GLIDER/SYSTEM.dbf $ expr index $LOCATION SYSTEM expr: syntax error $ expr index "$LOCATION" SYSTEM expr: syntax error ... (5 Replies)
Discussion started by: seafan
5 Replies

4. Shell Programming and Scripting

Need-To remove header/trailor and add-date-on first-postion-plz-help

Hi Friends thanks a lot....for ur replies its worked fine...i have one more question.. if i need to remove trailor (T000000004 ) as shown below file also with header.Plz help thanks Source file: H20100928 D04041201609360677PC790010384I D04041203326357853PC790010645R ... (1 Reply)
Discussion started by: dprakash
1 Replies

5. UNIX for Dummies Questions & Answers

Append line and variable at fixed postion in file in unix

Hi I have a input file ::: 1583904589034853904 1690234849023849023 159823890238409 1690238490238490238490 . . . The output file should have the record 16 appended to the record 15 and a variable should be added at a FIXED POSTION at 55. The records are been processed inside a loop... (3 Replies)
Discussion started by: akashhello
3 Replies

6. Shell Programming and Scripting

replace only 1st word of a line if it comes in the subsequent lines at same postion.

I have a file like this.. Maharastra Mumbai worli Maharastra Mumbai navy maharatra Pune Maharastra Nagpur Karnataka Bangalore Karnataka Mysore Karnataka Mangalore Punjab Amritsar punjab Jalandar my expected outcome should be like this Maharastra Mumbai worli ---------- ... (9 Replies)
Discussion started by: geeko
9 Replies

7. Shell Programming and Scripting

VI editor,column postion

In VI editor ctrl + g is used indicate the line number on which the cursor is placed...similarly is there a way to determine the column number of the cursor position..? (1 Reply)
Discussion started by: vijay_0209
1 Replies

8. Shell Programming and Scripting

curser control ~ multi line progress bar

Hi there, I have progress bars in several of my scripts, they work by deleting what has already been writen out, using: clear = "\\010"*( length of string i want to delete ) clearCmd = "echo -ne \""+clear+"\"" os.system(clearCmd) I then re-write the percent done & the progress... (4 Replies)
Discussion started by: purest
4 Replies

9. UNIX for Dummies Questions & Answers

How to grep at a given postion

All, I need to grep for a value between particular positions: Eg: ACME CORPORATION 3 213.89 I need to look out for the value 3 betwen postions 20 and 26. Any ideas. Thanks KP. (3 Replies)
Discussion started by: kingofprussia
3 Replies

10. UNIX for Dummies Questions & Answers

Positioning curser at EOF in vi

Hi there, Is there a way to position the cursor at EOF in vi, I know from the man pages how to position the cursor at the end of a paragraph, but what about the EOF (End Of File). Regards (6 Replies)
Discussion started by: JimJim
6 Replies
Login or Register to Ask a Question
glutGet(3GLUT)							       GLUT							    glutGet(3GLUT)

NAME
glutGet - retrieves simple GLUT state represented by integers. SYNTAX
int glutGet(GLenum state); ARGUMENTS
state Name of state to retrieve. GLUT_WINDOW_X X location in pixels (relative to the screen origin) of the current window. GLUT_WINDOW_Y Y location in pixels (relative to the screen origin) of the current window. GLUT_WINDOW_WIDTH Width in pixels of the current window. GLUT_WINDOW_HEIGHT Height in pixels of the current window. GLUT_WINDOW_BUFFER_SIZE Total number of bits for current layer of current window's color buffer. For an RGBA window, this is the sum of GLUT_WIN- DOW_RED_SIZE, GLUT_WINDOW_GREEN_SIZE, GLUT_WINDOW_BLUE_SIZE, and GLUT_WINDOW_ALPHA_SIZE. For color index windows, this is the size of the color indexes. GLUT_WINDOW_STENCIL_SIZE Number of bits in the current layer of current window's stencil buffer. GLUT_WINDOW_DEPTH_SIZE Number of bits in the current layer of current window's depth buffer. GLUT_WINDOW_RED_SIZE Number of bits of red stored the current layer of current window's color buffer. Zero if the current layer of the current window is color index. GLUT_WINDOW_GREEN_SIZE Number of bits of green stored the current layer of current window's color buffer. Zero if the current layer of the current window is color index. GLUT_WINDOW_BLUE_SIZE Number of bits of blue stored the current layer of current window's color buffer. Zero if the current layer of the current window is color index. GLUT_WINDOW_ALPHA_SIZE Number of bits of alpha stored the current layer of current window's color buffer. Zero if the current layer of the current window is color index. GLUT_WINDOW_ACCUM_RED_SIZE Number of bits of red stored in the current layer of current window's accumulation buffer. Zero if the current layer of the current window is color index. GLUT_WINDOW_ACCUM_GREEN_SIZE Number of bits of green stored in the current layer of current window's accumulation buffer. Zero if the current layer of the cur- rent window is color index. GLUT_WINDOW_ACCUM_BLUE_SIZE Number of bits of blue stored in the current layer of current window's accumulation buffer. Zero if the current layer of the cur- rent window is color index. GLUT_WINDOW_ACCUM_ALPHA_SIZE Number of bits of alpha stored in the current layer of current window's accumulation buffer. Zero if the current layer of the cur- rent window is color index. GLUT_WINDOW_DOUBLEBUFFER One if the current layer of the current window is double buffered, zero otherwise. GLUT_WINDOW_RGBA One if the current layer of the current window is RGBA mode, zero otherwise (i.e., color index). GLUT_WINDOW_PARENT The window number of the current window's parent; zero if the window is a top-level window. GLUT_WINDOW_NUM_CHILDREN The number of subwindows the current window has (not counting children of children). GLUT_WINDOW_COLORMAP_SIZE Size of current layer of current window's color index colormap; zero for RGBA color model layers. GLUT_WINDOW_NUM_SAMPLES Number of samples for multisampling for the current layer of the current window. GLUT_WINDOW_STEREO One if the current layer of the current window is stereo, zero otherwise. GLUT_WINDOW_CURSOR Current cursor for the current window. GLUT_SCREEN_WIDTH Width of the screen in pixels. Zero indicates the width is unknown or not available. GLUT_SCREEN_HEIGHT Height of the screen in pixels. Zero indicates the height is unknown or not available. GLUT_SCREEN_WIDTH_MM Width of the screen in millimeters. Zero indicates the width is unknown or not available. GLUT_SCREEN_HEIGHT_MM Height of the screen in millimeters. Zero indicates the height is unknown or not available. GLUT_MENU_NUM_ITEMS Number of menu items in the current menu. GLUT_DISPLAY_MODE_POSSIBLE Whether the current display mode is supported or not. GLUT_INIT_DISPLAY_MODE The initial display mode bit mask. GLUT_INIT_WINDOW_X The X value of the initial window position. GLUT_INIT_WINDOW_Y The Y value of the initial window position. GLUT_INIT_WINDOW_WIDTH The width value of the initial window size. GLUT_INIT_WINDOW_HEIGHT The height value of the initial window size. GLUT_ELAPSED_TIME Number of milliseconds since glutInit called (or first call to glutGet(GLUT_ELAPSED_TIME)). GLUT_WINDOW_FORMAT_ID The window system dependent format ID for the current layer of the current window. On X11 GLUT implementations, this is the X vis- ual ID. On Win32 GLUT implementations, this is the Win32 Pixel Format Descriptor number. This value is returned for debugging, benchmarking, and testing ease. DESCRIPTION
glutGet retrieves simple GLUT state represented by integers. The state parameter determines what type of state to return. Where appropri- ate, window capability state is returned for the layer in use. GLUT state names beginning with GLUT_WINDOW_ return state for the current window. GLUT state names beginning with GLUT_MENU_ return state for the current menu. Other GLUT state names return global state. Request- ing state for an invalid GLUT state name returns negative one. SEE ALSO
glutDeviceGet, glutLayerGet, glutGetColor, glutGetWindow, glutGetMenu, glutGetModifiers, glutExtensionSupported AUTHOR
Mark J. Kilgard (mjk@nvidia.com) GLUT
3.7 glutGet(3GLUT)