LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   GTK programming (https://www.linuxquestions.org/questions/programming-9/gtk-programming-309783/)

geminigal 04-04-2005 09:52 PM

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...

ahwkong 04-05-2005 01:04 AM

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/

BenneJezzerette 04-05-2005 01:34 AM

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

ahwkong 04-05-2005 02:16 AM

Quote:

GTK = Gnu Tool Kit
What does this mean?

GTK is Gimp Tool Kit (http://www.gtk.org/)

BenneJezzerette 04-05-2005 02:24 AM

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.

geminigal 04-05-2005 03:03 AM

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...

BenneJezzerette 04-05-2005 12:19 PM

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?

ahwkong 04-05-2005 04:00 PM

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?

ahwkong 04-06-2005 12:19 AM

This example should be very easy to understand

http://www.linuxheadquarters.com/how...ledialog.shtml

BenneJezzerette 04-06-2005 01:04 AM

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.

geminigal 04-06-2005 03:56 AM

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?

ahwkong 04-06-2005 04:30 AM

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.


All times are GMT -5. The time now is 12:01 AM.