LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Writing a GUI (https://www.linuxquestions.org/questions/programming-9/writing-a-gui-230429/)

hubabuba 09-14-2004 06:41 AM

Writing a GUI
 
Hi!

Couple of days ago i posted a message about Pascal and Kylix enterprise 3.
I was advised not to move dive into Kylix staight away (i'm new to programming), but rather use a simpler pascal compiler.
The reason for me wishing to use Kylix is because i need to write a KDE GUI for configuring IP Firewall, DHCP, DNS etc. I don't know which compiler to use because Kylix doesn't seem to like Pascal (it won't compile a simple 'hello world' program).
Will it be possible to write a GUI in pascal for configuring the services in Kylix? Will it be possible at all to write the GUI in pascal or do i need to use Delphi?

Thanks

chrism01 09-14-2004 06:52 AM

This may seem a bit off the wall ( I haven't seen your orig post), but do you have to write your own GUI at all ie have you looked at Webmin?
Just a thought...

hubabuba 09-14-2004 12:16 PM

I have to write a GUI, this is my uni project.

N43 09-14-2004 01:37 PM

You don't need to use Delphi. Kylix is nearly the same as Delphi/CBuilder. Did you really generate a console application? You can't build a console application with the standard project that appears automatically at startup.

@chrism01: here is his other post

hubabuba 09-15-2004 12:52 PM

I apologise if my question wasn't clear. I want to know if I can use Pascal to write a GUI configuration tool in Kylix because I couldn't even compile a simple pascal program in Kylix. Do i need to install additional parts/modules for Kylix to enable Pascal support? Is pascal suitable for writing GUI applications for KDE at all, maybe i have to use Delphi or something?

Please help, i'm confused

Thanks

N43 09-15-2004 02:06 PM

Kylix supports two languages. Delphi/Pascal and C/C++. There are not many differences between Delphi and Kylix but the programming language is the same.

You should use Delphi if you want to build a win32 application and Kylix if you want to build a Linux application.

You may post the code of your pascal program that didn't work and I'll have a look on it.

hubabuba 09-16-2004 09:40 AM

The pascal program that i've tried is just a simple 'hello world':

program prog1_1(input, output);
begin
writeln('Hello World');
end.

Thanks

N43 09-16-2004 11:07 AM

This program should work with Kylix. What does apper when Kylix starts up? There should be a form, an editor window, the object inspector and the object treeview. When you just replace all the code with your code you will get the error message you posted in the other thread. It's simple to get it work. Just create a new console project with File -> New -> Other... or click on the new project icon. Now you can select from different project types. Here you have to select 'Console Application'. You might just see 'Console...'. Double click on it or click on OK after selecting it.

If everything worked you should see the line '{$APPTYPE CONSOLE}' in the editor window. Just replace the code in the editor window with your code.

When you run it you won't see any result. Store the project in a directory you want and compile it. Start a terminal-program, change to your directory and run your project. You just have to do this when you are developing a console application.

alexrait1 09-16-2004 12:49 PM

You don't need kylix for that. The best way to write gui with kde I think, is to use the QT library. Either in python or in c++.

I wrote something similar for internet sharing configuration:
http://kazit.berlios.de/newsite/tmp/...ntershare1.png
http://kazit.berlios.de/newsite/tmp/...ntershare2.png

I also tried to use wxWindows, but I didn't like it, since it doesn't have a good (intuitive) gui designer like the qt-designer (boa-constructor is awful).
Gtk has extensive c interface that's the first (and the crucial) reason to rule it out.

again python + qt, the best choice for quick gui.

suowei1979 09-16-2004 08:56 PM

You can use the MiniGUI library
http://www.minigui.org

hubabuba 09-17-2004 07:55 AM

Thanks for all your help and the pascal in Kylix is working. I'll probably start learning C++ as well.


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