Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[XForms] bypassing argc and argcv

0 views
Skip to first unread message

Patrick

unread,
Aug 26, 2015, 3:32:30 PM8/26/15
to xforms-de...@nongnu.org
Hi Everyone

I would like to call fl_initialize from another program that is main()
but sending fl_initialize(0, NULL, 0, 0, 0);

does not work.

I found this post:
http://xforms-toolkit.org/old-archive/2000/0481.html

but it did not cover this. Does xforms assume it will be initialized
from main?

BTW I am using only one thread.

Thanks-Patrick

Jens Thoms Toerring

unread,
Aug 26, 2015, 3:47:56 PM8/26/15
to Development with and of XForms, Patrick
Hi Patrick,

On Wed, Aug 26, 2015 at 02:36:29PM -0400, Patrick wrote:
> I would like to call fl_initialize from another program that is
> main()

I guess you meant from anoyther function that isn't main()?

> but sending fl_initialize(0, NULL, 0, 0, 0);
>
> does not work.
>
> I found this post:
> http://xforms-toolkit.org/old-archive/2000/0481.html
>
> but it did not cover this. Does xforms assume it will be initialized
> from main?

You can call fl_initialize() from anywhere if you feel like
it. But it needs at least on argument (which is tyically the
name of the program) and doesn't accept none at all. But
should be able to get around that by doing e.g.

void myfunct( void )
{
int cnt = 1;
char *args[ 2 ] = { "", NULL };
fl_initilize( &cnt, args, 0, 0, 0 );
}

That way fl_initialize() gets what it wants. But you then
should be aware that with this the user will not be able
to set XForms specific flags (e.g. the display the program
is to use, and several others). If you don't want that you
have to pass the arguments main() received somehow to your
function that then calls fl_initialize() with them.

Best regards, Jens
--
\ Jens Thoms Toerring ________ j...@toerring.de
\_______________________________ http://toerring.de

Patrick

unread,
Aug 26, 2015, 9:54:43 PM8/26/15
to j...@toerring.de, Development with and of XForms
Hi Jens

Thanks very much.

I have used GTK, QT, FLTK and Tcl/TK for small projects along with many
bindings. I am actually pretty excited about xforms. Many toolkits are
written in c++ and it wants to be the center of the universe. GTK is not
but it is very large and covered in macros and Tk is okay but closely
linked to Tcl. With a possible exception of Python most bindings are not
very good as writing them is a monumental task.

I am actually trying to call into xforms from GnuCOBOL. I have tons of
other questions but I will try to figure them out with the documentation.

Have a great day and thanks for keeping xforms alive and well-Patrick




















0 new messages