gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] OC_GTK help


From: Paul McNary
Subject: Re: [open-cobol-list] OC_GTK help
Date: Wed, 08 Jul 2009 19:53:37 -0500
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Hello Michael

I didn't get all of this thread directly for some reason.> cobc -c `pkg-config 
--cflags gtk+-2.0` ocgtk.c
> cobc -x -W -debug `pkg-config --libs gtk+-2.0` gtkhello.cob ocgtk.o

I went back and looked at the list archive.

You right in that cob_module and module are found in common.h.
which should be found with -I/usr/local/include/libcob
on the compile line. (That is a dash capital I).

Then in the link command you will have to have -lcob in the link command.
This will include libcob.so if found in your default library path.


> cobc -c `pkg-config --cflags gtk+-2.0` ocgtk.c
> cobc -x -W -debug `pkg-config --libs gtk+-2.0` gtkhello.cob ocgtk.o


Change to
cobc -c `pkg-config --cflags gtk+-2.0` -I/usr/local/include/libcob ocgtk.c
cobc -x -W -debug `pkg-config --libs gtk+-2.0` -lcob gtkhello.cob ocgtk.o

I think all you are missing is -lcob (small L cob) in your 2nd cobc command.
COBOL calling C should not have changed in the newer versions.


You may also need to add pkg-config --cflags glib-2.0
and pkg-config --libs glib-2.0.
I do on my UNIX but the gtk pkg-config on yours may already return those.

That should give you a clean compile.
I have come from the COBOL world for over 30 years and learning C has been
a real struggle. I have the original demos working on SCO OpenServer 6
and MicroFocus Server Express 5.1. I give you working examples for that 
environment
with out any trouble.

But like I said before, if you use Glade-3 with either libglade and or 
GTKBuilder
(which is part of the latest releases of GTK) all of the interface coding
work that you see in Brian's example is eliminated. All of the interface
particulars are done in the Glade RAD tool which creates an XML file loaded
at runtime. Code your callbacks and you have a complete app.

The -lcob should get you compiled, if not let me know.

Take care

Paul
address@hidden





Michael wrote:
Paul,

I think Brain Tiffin may have added to the original example. When looking at the ocgtk.c source here: http://svn.wp0.org/ocdocs/brian/ocgtk.c it does contains a `#include "ocgtk.h"` in the source file, not to mention addition code in some of the routines in it.

Also see http://svn.wp0.org/ocdocs/brian/gtkhello.cob


cobc -c `pkg-config --cflags gtk+-2.0` ocgtk.c
cobc -x -W -debug `pkg-config --libs gtk+-2.0` gtkhello.cob ocgtk.o

If you look at the original post to this thread, you'll see that I had problems with the ocgtk.c version that you are referring to. Brain said that changes made to OpenCobol caused it to fail. Some compile/link issue related to module and cob_module. So currently neither version works with the latest version of OpenCobol.

Michael Anderson,
832.515.3868



Paul McNary wrote:
Hello Michael

The GTK OpenCOBOL example I started with is at:

http://add1tocobol.com/tiki-index.php?page=GTK+Sample

Both the COBOL piece and the C pieces are on that page.
It was done by: Brian Tiffin address@hidden

I have been playing with it and use Glade-3 Interface
Designer with the GTKBuilder functionality (I actually
starting playing with libglade first) and it appears to
be able to create a GUI for new work very quickly. The
callbacks can be in either C or COBOL. The callbacks
and all can be managed in Glade-3 as far as creating
the stubs. All you have to do is create the callback
functions.

I am not using OpenCOBOL but this source example has
gotten further than anything I have looked for, for years.
I have been using MicroFocus COBOL for decades but OpenCOBOL
looks very interesting.

I have looked at Qt and Flexus. I think Qt would be fine
if you are comfortable with C++. There is also a Vala example
in the OpenCOBOL docs that gives one several GUI interface options for
?Nix. I wanted only a ?nix solution, no windows, so using GTK on
windows hasn't been an issue for me. Qt has a nice GUI designer
and I think the interface to COBOL would be similar. With Qt
you have to make sure you understand the licensing between versions.
I think Qt4 has GPL and Commercial licensing available. Maybe LGPL.
Qt3 and before was only GPL and Commercial.

So GTK or Vala are both fast development environments for adding
a GUI to COBOL and add Glade-3 with libglade or preferably GTKBuilder
and you have a fairly RAD system.

Paul McNary
address@hidden


Michael wrote:
David,

You mentioned Native windows API for GUI development, and I appreciate the input. Have you looked at Qt? I heard that it is platform-independent. I heard that Qt uses the native API for GUI development on whatever platform it is running on. For native windows I have used a commercial product called Cobol SP2, from Flexus, it is multi-platform, but when running on unix it still requires a Windows ThinClient. For the HP3000 migration stuff I highly recommend SP2 for screen conversions, and the Eloquence DBMS for database conversion. But sill, I have no real Linux (or GNU/GPL) solution for GUI screens.

Michael Anderson,
832.515.3868



David Essex wrote:
Michael wrote:
...
<Optionalreading>
I've been using Linux for years, but only using it (network config, web/html , email, ftp, and stuff like that), no real programming. I've been writing Fortran, COBOL, and some C for decades in the mini-mainframe world, started with Fortran/66 in 1983, then ansi74 COBOL in 1986, very little C. OpenCobol is my path to multi platform programming. I really want to _thank everyone _evolved in developing OpenCobol. There are other areas I need to conquer in a multi-platform environment, GUI, DBMS, and System calls or intrinsics. However, right now I can't seem to compile anything worthwhile! When (not if) I get running with this, I'll be serious advocate for OpenCobol!
</Optionalreading>
GTK is a UN*X toolkit, and a front end to the WinAPI.
It is rarely used on WinXP (even with Cygwin or MinGW).

A native WinAPI C application is relatively easy to write.
And since OC generates C code, it is easy to integrate.

Brian, maybe you could add an native WinAPI example to your FAQ, for
Cygwin (MinGW) users.

You can find a trivial example included in the TC source code [1]
(test.code/tgui02).

Hope this helps.

1) TinyCOBOL download
http://tiny-cobol.sf.net/download.php
http://prdownloads.sf.net/tiny-cobol/tinycobol-0.64.tar.bz2


------------------------------------------------------------------------------
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list

------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list




------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list





reply via email to

[Prev in Thread] Current Thread [Next in Thread]