LinuxQuestions.org
Visit Jeremy's Blog.
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 10-15-2005, 02:51 PM   #1
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Rep: Reputation: 30
Question How to start GTK programming in C++?


hi guys,

i have to do some graphics programming in c++.so i tried using the old <graphics.h>, but since it was meant only for Turbo C, it did'nt workout.

So, how do i do graphics programming in c++, in linux??

please help!!
 
Old 10-15-2005, 03:26 PM   #2
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
for graphic in linux , if you want you may have a look at SDL

this is one of the tutorial ::
http://cone3d.gamedev.net/cgi-bin/in...s/ogladv/index


hope it helps ...
 
Old 10-15-2005, 10:34 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Play with some of the demos in the GTK+ tutorial:
http://www.gtk.org/tutorial/

PS:
Please bear in mind: even if you want to write your application in C++, a procedural 'C" API is often the most effective way to do it. This is definitely true of SDL and, IMHO, also of GTK+.

Last edited by paulsm4; 10-15-2005 at 10:35 PM.
 
Old 10-16-2005, 11:28 AM   #4
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Original Poster
Rep: Reputation: 30
Thumbs up thanx guys.....

thanx for the help guys, i got some really nice tutorials.

But most of these are C based. Can i get any tutorials that are specific to C++.

please help!
 
Old 10-17-2005, 01:27 AM   #5
lowpro2k3
Member
 
Registered: Oct 2003
Location: Canada
Distribution: Slackware
Posts: 340

Rep: Reputation: 30
The GTK library is written in C as far as I understand. You can write code in C++ instead, but you're fighting an uphill battle, especially if you dont understand C. I would learn a different API such as QT or WxWidgets if I were you. Or learn C. What is it about the examples you dont understand? C is very similiar to C++, especially if you dont have a firm handle on C++ classes, exceptions and the STL.
 
Old 10-17-2005, 03:22 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
If you want to write graphical programs in C++ using GTK, then you'll have to use gtkmm.
 
Old 10-17-2005, 01:56 PM   #7
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Original Poster
Rep: Reputation: 30
Thumbs up thanx Nylex...

thanx dude,

u really helped me out.., i hope now i can try my hands at linux graphics programming... using c++.
But the gtkmm.org has'nt got any full tutorials on it....??
 
Old 10-17-2005, 02:05 PM   #8
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
You absolutely, totally do *not* have to use gtkmm if you want to write in C++. You can (and, I would argue *should*) code to the standard GTK+ 2.0/GDK API from your C++ classes. You may, of course, use gtkmm if you prefer to. But you do NOT have to. And personally, I prefer not to.

IMHO .. PSM

Last edited by paulsm4; 10-17-2005 at 02:06 PM.
 
Old 10-17-2005, 02:17 PM   #9
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Original Poster
Rep: Reputation: 30
thanx for the advice, i'll consider it......
 
  


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
GTK programming linetnew Programming 1 10-12-2005 11:34 AM
gtk programming sharapchi Programming 3 06-21-2005 02:22 PM
GTK programming geminigal Programming 1 06-02-2005 03:08 AM
Gtk programming geminigal Programming 2 05-11-2005 08:07 PM
GTK and programming NSKL Programming 2 01-14-2003 03:30 PM

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

All times are GMT -5. The time now is 11:40 AM.

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