LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-21-2008, 08:40 PM   #1
thinice15
Member
 
Registered: Feb 2008
Distribution: Slackware 12.0
Posts: 37

Rep: Reputation: 15
I want to make a simple curosr program using C please help


I recently started programming in C and i was wondering if someone could help me make a simple cursor program.

I have Slackware 12.0 with Nvidia 7800 GS OC and i use the gcc compiler.

-thanks
 
Old 04-21-2008, 09:17 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Do you mean an X11 program? What is your definition of a “simpler cursor” program? If you want to interface with X11 directly, use libX11. If you want to use an intermediate toolkit such as GTK, Qt, etc., you may do that as well. If you want a fancy console-based program, try libcurses.
 
Old 04-22-2008, 10:39 AM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Which cursor? Text or pointer? For controlling the mouse cursor, osor seems to have the right idea. For controlling text cursor, you can either use the appropriate escape codes for the terminal type your program runs under, or use the curses/ncurses library to do the work in a more standardized way.
--- rod.
 
Old 04-23-2008, 01:20 AM   #4
thinice15
Member
 
Registered: Feb 2008
Distribution: Slackware 12.0
Posts: 37

Original Poster
Rep: Reputation: 15
I have no idea... but whatever would be the most understanding way to make a cursor program by cursor program i mean just be able to print and move a cursor around i seen my uncle do it he just used text or something it seemed very understanding but i wasn't into C but i am now.

-thanks

Last edited by thinice15; 04-23-2008 at 09:09 PM.
 
Old 04-23-2008, 09:44 AM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I guess you didn't notice that most GUIs can have two cursors. Of course you didn't specify whether the program should run under X, or any other GUI interface. I think you need to think things through a bit, then reformulate your question.
--- rod.
 
Old 04-23-2008, 09:03 PM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
In C you have to group and terminate statements with '{', '}' and ';'. In English we use periods ('.'), commas (',') and CAPITALS for that purpose. Maybe if you did as well we actually could understand your question.

jlinkels
 
Old 04-23-2008, 09:08 PM   #7
thinice15
Member
 
Registered: Feb 2008
Distribution: Slackware 12.0
Posts: 37

Original Poster
Rep: Reputation: 15
Ok i dont want the cursor to run under x. I just want it to be a simple cursor created by a C program and i dont have any GUIs but i get your point.

im sorry the first reply i messed up i just want a cursor sorry for the confusion.

-thanks

Last edited by thinice15; 04-23-2008 at 09:10 PM.
 
Old 04-23-2008, 09:27 PM   #8
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
As I said before,
Quote:
Originally Posted by osor View Post
If you want a fancy console-based program, try libcurses.
 
Old 04-24-2008, 02:45 AM   #9
thinice15
Member
 
Registered: Feb 2008
Distribution: Slackware 12.0
Posts: 37

Original Poster
Rep: Reputation: 15
Well I'm kinda new to C can you explain to me what "libcurses" is?

-thanks
 
Old 04-24-2008, 10:47 AM   #10
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
do this:
Code:
man ncurses
In general terms, curses is a package used to control cursors and other screen elements. ncurses is a specific implementation of curses, and is included with many Linux distributions. libcurses is the C-callable library that implements the functionality of curses.

BTW, cursors are generally not created by user applications, but are merely controlled by them. Depending on the platform upon which the application runs, the cursor may be implemented in the video hardware. The things you can control would be attributes such as row & column position, size, shape, blinking/rate, etc.

BTW2: see my sig.

--- rod.

Last edited by theNbomr; 04-24-2008 at 10:54 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple C++ Program: Program Compiles But Won't Run (Segmentation Fault) violagirl23 Programming 3 01-09-2008 12:09 AM
How do I make a simple script and make it run on bootup?? coolblue Programming 5 12-18-2006 09:55 PM
can i make a script or program make a phone call? nephish Linux - Software 2 08-15-2005 09:02 PM
simple program help! rohitkara Linux - General 1 05-24-2005 08:57 PM
i make a program using forte how can i generate from that program an rpm abdelhlims Programming 0 07-13-2004 12:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration