xforms-development
[Top][All Lists]
Advanced

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

Re: [XForms] Looking for simple example


From: jon
Subject: Re: [XForms] Looking for simple example
Date: Sat, 08 Nov 2014 12:13:00 +0000

On Sat, 2014-11-08 at 12:27 +0100, Jens Thoms Toerring wrote:
> Hi Jon, 
> 
> On Sat, Nov 08, 2014 at 03:44:48AM +0000, jon wrote:
> > I like the fdesign editor, at first glance it does not look very
> > powerful but after a few hours getting used to it I managed to design a
> > quite complex form.
> 
> I don't know if you've already noticed that when you want an
> array of objects fdesign will allow you also this: all you
> need to do is to set something like 'arr[0]', 'arr[1]' as
> the object names and fdesign will accept them and create
> an array of objects named 'arr' with the appropriate number
> of elements.

I had not noticed, thanks. I was hand editing the results after using
fdesign.

I am having problems with timers, the examples are little over complex.
All I am after is a callback to run every 100ms or so for the entire
time the form is active, but the examples seem rather over clever.


I get this output and no timer ticks ?
In fl_add_object() [objects.c:258]: NULL form for 'FL_TIMER'


I am trying something like this, but so far it is not working out :  


FL_OBJECT *tim;
void timertick(FL_OBJECT *obj, long q)
{
        printf("timer\n");
        fflush(stdout);
//fl_set_timer(tim,100);
}


int main( int argc, char * argv[ ] )
{
    FD_mixerform *fd_mixerform;

    fl_initialize( &argc, argv, 0, 0, 0 );
    fd_mixerform = create_form_mixerform( );

    tim = fl_add_timer(FL_HIDDEN_TIMER,100,0,0,0,"Time"); 
    fl_set_object_callback(tim, timertick, 0);
    fl_show_form( fd_mixerform->mixerform, FL_PLACE_CENTERFREE, FL_FULLBORDER, 
"mixerform" );

    fl_set_timer(tim,100);

    fl_do_forms( );

    if ( fl_form_is_visible( fd_mixerform->mixerform ) )
        fl_hide_form( fd_mixerform->mixerform );
    fl_free( fd_mixerform );
    fl_finish( );

    return 0;
}





reply via email to

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