xforms-development
[Top][All Lists]
Advanced

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

Re: [XForms] clock object with selector for show_seconds


From: Brian Tiffin
Subject: Re: [XForms] clock object with selector for show_seconds
Date: Tue, 15 Aug 2017 10:49:53 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46

Jens Thoms Toerring wrote:
> Hi Brian,
>
> On Mon, Aug 14, 2017 at 05:25:06PM -0400, Brian Tiffin wrote:
>> I have a small patch to allow clock objects to set/reset show_seconds.
>>
>> Added a show_seconds field to the spec, and an
>> fl_clock_set_show_seconds( obj, int show) (modeled on fl_set_clock_ampm
>> function to clock.c, clock.h and forms.h.  Along with some spec derived
>> if statements to control formatting the digital clock and skipping the
>> second hand drawing in clock.c.
>>
>> Is this a worthy patch to send you Jens?
> Yes, of course. Sounds reasonable to me and shouldn't intro-
> duce any incompatibilities.
To avoid changing current default expectations, function was renamed to
fl_clock_hide_seconds instead of show_seconds.  Along the same vein, the
width of the digital clock work buffer is left the same, with or without
seconds.
>
>> I've become keen on using XForms with the GnuCOBOL project.  Once we get
>> out 2.2 release out the door I'd like to take a kick at generating code
>> from SCREEN SECTION in COBOL to replace ncurses TUI screens with XForms
>> GUI screens (optionally by keyword in COBOL and depending on ./configure
>> --with-xforms).  Maybe.  If the experiments keep succeeding as they have.
>>
>> I have a small intro building up in the GnuCOBOL discussion group at
>> https://sourceforge.net/p/open-cobol/discussion/lounge/thread/a2ad7a19/
> Sounds interesting! Just a warning in case you don't already know:
> XForms is tightly bound to X11, so there's probably no chance of
> ever using it on platforms that don't use X11 (e.g. Windows).
:-)

Understood.

As a GNU project volunteer, enticing folk away from Windows can only be
seen as a good thing.
>
>> Would you like the patch sent?  I'd need guidance on updating the doc
>> set to include the fl_set_clock_show_seconds() function, or if you'd
>> like a different name other than show_seconds, etc.
> Yes, sent it over to me! I'm actually finished with preparations
> for a new pre-release (that hopefully soon becomes a "real" new
> release) but I guess your patch will be simple enough to include
> at a late moment. Don't worry about the documentation, I guess I
> can add that myself in a few minutes. The function name looks ok
> to me.
>                    Thank you and best regards, Jens
I updated the demo/flclock.c file too.  You may want to edit out the
first hunk of patch to keep the demo consistent.

And (excuses mode), I did this on the quick, so feel free to make more
changes.  For instance, I used the FL_UNUSED_ARG ob->type field in
draw_clock to pass the hide_seconds parameter.  Looking at it now, it
might be better to just add a new argument to the end of the function
prototype to get the SPEC field passed in.

Looking forward to exploring more XForms.  Thanks, Jen.

Have good,
Brian

Attachment: xforms-hide-seconds.patch
Description: Text Data


reply via email to

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