LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 06-20-2010, 01:53 PM   #1
iqra
Member
 
Registered: May 2010
Posts: 34

Rep: Reputation: 15
Question user interface for C language program in linux


hiii,

i want to make user inteface for my C program in linux.
is there any way other than GTK Glade interface?? i never used Glade before so i do not know weahter i could make UserInterface for my C program in that or not? as Glade has its own programing syntax!

plz help!!! :-)

Regards!
 
Old 06-20-2010, 02:25 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by iqra View Post
hiii,
...
plz help!!! :-)
...
First read the manual, then ask. I.e. you can write your GUI directly in gtk+.
 
Old 06-20-2010, 05:35 PM   #3
ryan858
Member
 
Registered: Feb 2009
Distribution: Slackware 12.2
Posts: 37

Rep: Reputation: 16
I'm a newb too, and have never messed with making GUI's (well I've tried a couple times and got overwhelmed and gave up), but I think the basic principal is, you use a framework and build your app around it... Think of it like constructing a building... You have to build up the framework (i.e. steel beams and stuff) then lay your concrete on top of that so it doesn't all collapse. Of course you can do it without that framework, and build something of wood or whatnot, like a house (though that still uses a frame, but that's beside the point). And you can use different frameworks to suit your needs or personal preference.

Keep in mind this is a very lamens-term description, coming from a guy who knows next to nothing about the subject...

But anyway, you can use the Qt libs, or GKT+, or whatever you want. I'm sure there are more, but those are the popular ones. Basically you make your app in plain old C, as a command-line tool, then add in the GUI components, or you can start from scratch and use your CLI (Command Line Interface) tool as a reference, while building the GUI app from the ground up, based on the source code of CLI version.

It's more complicated than how I worded it, but that's the basic gist of it.

And like I said, please keep in mind that I may actually have no idea what I'm talking about! (But I think I do!)

Last edited by ryan858; 06-20-2010 at 05:37 PM.
 
Old 06-20-2010, 08:22 PM   #4
easuter
Member
 
Registered: Dec 2005
Location: Portugal
Distribution: Slackware64 13.0, Slackware64 13.1
Posts: 538

Rep: Reputation: 62
I think as far as using C for GUI programming you are pretty much limited to GTK and (ugh) Motif.
Visit the GTK website, they have lots of documentation you can browse through.
 
Old 06-21-2010, 12:14 AM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
The original post said "user interface", so that could include curses/ncurses. Not graphical, but still a UI, and not too hard to learn, although the experience will not be very transferable to other UIs.
--- rod.
 
Old 06-21-2010, 01:01 AM   #6
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,908

Rep: Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545
Quote:
Originally Posted by theNbomr View Post
The original post said "user interface", so that could include curses/ncurses.
Or SDL and OpenGL, which are also C-based.
 
Old 06-21-2010, 09:11 AM   #7
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
Nobody said you have to use Glade, just design the UI in your code!

Also check out Qt (It also has a GUI-based interface designer called "Qt Designer", although there is nothing wrong with writing the UI in your code).
 
Old 06-21-2010, 09:54 AM   #8
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,908

Rep: Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545
Quote:
Originally Posted by ryan858 View Post
you can use the Qt libs
Quote:
Originally Posted by MTK358 View Post
check out Qt
Qt needs C++.
 
Old 06-21-2010, 10:56 AM   #9
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Originally Posted by dugan View Post
Or SDL and OpenGL, which are also C-based.
Aren't those really graphics libraries/toolkits more than UIs?
--- rod.

Last edited by theNbomr; 06-21-2010 at 10:58 AM.
 
Old 06-21-2010, 10:57 AM   #10
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
Yes, they're not UIs.
 
Old 06-21-2010, 12:19 PM   #11
iqra
Member
 
Registered: May 2010
Posts: 34

Original Poster
Rep: Reputation: 15
thanks to all for ur sugestions.. :-)

n sorry i didnt use a word 'Graphical'. thats what i actually need a GUI for my program. i need that type of tool or software that support C language and i just have to design the GUI and do not have to code again evry thing (of my program).

i worked on Windows( used Dreamweaver , Visual Studio) so i was wondering if i find such tool in Linux also!
 
Old 06-21-2010, 12:57 PM   #12
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
So you want a graphical program to lay out the widgets for your program's GTK+ GUI?

Then you want Glade.
 
Old 06-21-2010, 12:58 PM   #13
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
I think if you use Glade to generate the skeleton of your application GUI, you can drop to a C-only environment at the point when you're happy with the basic arrangement. As I understand it, the basic premise of GTK vs Windows is not very different in principle. Everything is a callback, and a response to a certain type of signal. I've never done any Windows GUI programming, but I believe the same concept is true there. In fact, I think the same is true for most GUI building toolkits.
I have done a bit of GTK coding, and after the initial learning curve, I found it fairly straightforward. You just need to have a decent reference on hand, to get the syntax right, and to see what options are possible. For GTK, I think the definitive reference is the online one at the GTK website. I also used a book which had a little more detail, but that was a few years ago, and I don't know what's been published more recently that is up-to-date and complete.

--- rod.
 
Old 06-21-2010, 12:59 PM   #14
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,908

Rep: Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545Reputation: 1545
Quote:
Originally Posted by theNbomr View Post
Aren't those really graphics libraries/toolkits more than UIs?
They give you the tools to build a UI, which is also what you get from ncurses.

Blender has an OpenGL-based UI.
 
1 members found this post helpful.
Old 06-21-2010, 04:22 PM   #15
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Originally Posted by dugan View Post
They give you the tools to build a UI, which is also what you get from ncurses.

Blender has an OpenGL-based UI.
Okay, I think I mis-worded my question. I suppose any graphics toolkit could be used to build a UI, but I still see a distinction between toolkits which are for general purpose graphics like drawing swirly colors and so on, versus a UI toolkit, which uses graphics to provide widgets which are active in some way, and which provides some framework for handling user actions from such as pointers and keyboards.

Curses provides a little of that, with things like menus and dialogs.

--- rod.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to make a web-based interface for user configuration program? hong2010 Linux - Software 8 04-09-2010 01:59 AM
New language user interface for any Linux distro, where do I start? hector3rd Linux - General 1 07-30-2009 01:48 PM
OpenOffice 3.0.1 "user interface language" error abti Linux - Software 3 06-01-2009 08:25 AM
Good linux chinese language language program? darsunt Linux - Software 1 04-10-2009 01:06 PM
SOLVED: OOo v3.0 FATAL ERROR: Unable to determine user interface language stress_junkie Linux - Software 0 02-13-2009 09:47 AM


All times are GMT -5. The time now is 04:54 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration