LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-04-2005, 09:52 PM   #1
geminigal
Member
 
Registered: Apr 2005
Posts: 53

Rep: Reputation: 15
GTK programming


hi ppl!

i m having difficulties in doing a popup message box using GTK+2.0 in my source code.

how do i write a code in which when a user clicked File at the menu bar, subsequently New, then a pop up message box will appear where the user can type in editable strings in it?

can somebody pls help and giv me a rough idea, and if possible some sample codings? tq tq...
 
Old 04-05-2005, 01:04 AM   #2
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
I think the use of a file selection dialog is more appropriate in this case.

There is a good set of example (in python however, but you did not specify the language anyway, so hopefully you don't mind :-)

http://www.ittc.ku.edu/~niehaus/clas..._gui_examples/
 
Old 04-05-2005, 01:34 AM   #3
BenneJezzerette
Member
 
Registered: Mar 2005
Location: In a Box where Slackware Rocks
Distribution: Slackware 11 -current
Posts: 274

Rep: Reputation: 30
Quote:
Originally posted by ahwkong
I think the use of a file selection dialog is more appropriate in this case.

There is a good set of example (in python however, but you did not specify the language anyway, so hopefully you don't mind :-)

http://www.ittc.ku.edu/~niehaus/clas..._gui_examples/
GTK = Gnu Tool Kit
 
Old 04-05-2005, 02:16 AM   #4
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
Quote:
GTK = Gnu Tool Kit
What does this mean?

GTK is Gimp Tool Kit (http://www.gtk.org/)
 
Old 04-05-2005, 02:24 AM   #5
BenneJezzerette
Member
 
Registered: Mar 2005
Location: In a Box where Slackware Rocks
Distribution: Slackware 11 -current
Posts: 274

Rep: Reputation: 30
Quote:
Originally posted by ahwkong
What does this mean?

GTK is Gimp Tool Kit (http://www.gtk.org/)
Learns a new term today - Gimp. Thank you, Guessing is not permitted, always be sure. So I guessed. Lol.
 
Old 04-05-2005, 03:03 AM   #6
geminigal
Member
 
Registered: Apr 2005
Posts: 53

Original Poster
Rep: Reputation: 15
hi may i know how do we embed the popup message when we clicked at New under the File (menubar) using GTK+2.0?

btw i dun use PyGTK though i find the examples useful.

Is GTK meant only for designing the interface? and there is no way you can link it to a list of document files provided you type some linux programming in it?

i m sorry cz i m still blur in that. Further more, how do i used the execlp(exec function used in terminal) to be used in the coding? I had tried but failed.

Pls help! tq...

Last edited by geminigal; 04-05-2005 at 03:04 AM.
 
Old 04-05-2005, 12:19 PM   #7
BenneJezzerette
Member
 
Registered: Mar 2005
Location: In a Box where Slackware Rocks
Distribution: Slackware 11 -current
Posts: 274

Rep: Reputation: 30
Quote:
Originally posted by geminigal
hi may i know how do we embed the popup message when we clicked at New under the File (menubar) using GTK+2.0?

btw i dun use PyGTK though i find the examples useful.

Is GTK meant only for designing the interface? and there is no way you can link it to a list of document files provided you type some linux programming in it?

i m sorry cz i m still blur in that. Further more, how do i used the execlp(exec function used in terminal) to be used in the coding? I had tried but failed.

Pls help! tq...
As for Programming, this is ALL new to me, so passes this to the one who can answer it. Hello??? Are you out there?
 
Old 04-05-2005, 04:00 PM   #8
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
Quote:
Originally posted by geminigal
hi may i know how do we embed the popup message when we clicked at New under the File (menubar) using GTK+2.0?
It is just about how to connect the event of menu clicked to the slot of firing a popup message. But unfortunately when I checked the GTK2.0 tutorial about this, the section is still not complete yet. Well, I will see what I can do.
Quote:
btw i dun use PyGTK though i find the examples useful.
Acutally what kind of development language you are using? C? C++? PyGTK can give you some idea how to use those high-level GUI objects, but if you do it in C and C+ you have to take care of more low level stuff.


Quote:
Is GTK meant only for designing the interface? and there is no way you can link it to a list of document files provided you type some linux programming in it?
Generally speaking GTK is for GUI only.

But in GLib (http://developer.gnome.org/doc/API/2.0/glib/index.html) there is a lot of tools which are not limited to GUI

If you are serious about learning more about programming in Linux in general, you should try buy some books on this subject.


Quote:
i m sorry cz i m still blur in that. Further more, how do i used the execlp(exec function used in terminal) to be used in the coding? I had tried but failed.
Details?
 
Old 04-06-2005, 12:19 AM   #9
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
This example should be very easy to understand

http://www.linuxheadquarters.com/how...ledialog.shtml
 
Old 04-06-2005, 01:04 AM   #10
BenneJezzerette
Member
 
Registered: Mar 2005
Location: In a Box where Slackware Rocks
Distribution: Slackware 11 -current
Posts: 274

Rep: Reputation: 30
Quote:
Originally posted by ahwkong
This example should be very easy to understand

http://www.linuxheadquarters.com/how...ledialog.shtml
First off, I love Linux!!!!

Later I will take a serious look at that and try to get some idea. gotthe GTK+ installer did the sh configure and then make and then make install and it loaded, I think it is GNU only not KDE. So may have to load it as a menu option in KDE.
 
Old 04-06-2005, 03:56 AM   #11
geminigal
Member
 
Registered: Apr 2005
Posts: 53

Original Poster
Rep: Reputation: 15
hi there again!

may i know why do i face this error while compiling the source code using gtk+?

could not find config.h

is there any way to solve this?
 
Old 04-06-2005, 04:30 AM   #12
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
include path issue.

Try modify -I parameter to gcc such that the location of config.h is included

It is not a GTK issue. It is a rather basic C compilation issue. It is better if you can read something about the use of gcc/g++ first.
 
  


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
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
Programming with GTK dfownz Programming 6 07-17-2004 01:50 PM
GTK and programming NSKL Programming 2 01-14-2003 03:30 PM


All times are GMT -5. The time now is 05:54 PM.

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