caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* LablTk internals
@ 2005-11-17 21:29 Matt Gushee
  2005-11-18  6:00 ` [Caml-list] " Jun Furuse
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Gushee @ 2005-11-17 21:29 UTC (permalink / raw)
  To: caml-list

Hello, all--

I am working on some enhancements to LablTk, to bring it up to date with
Tk 8.4. One of the features I want to implement is validation for Entry
and Spinbox widgets (the latter being a new widget that I have added
already). It looks like this will require support module(s) in the
'builtin' directory ... the validation commands are somewhat like event
bindings, in that they use fields (with % substitutions in Tcl syntax)
and require registering callbacks; on the other hand, unlike event
bindings, but like Button and Menu commands, they are bound to the
widgets with configuration options rather than a standalone binding command.

So I need to understand more about those 'builtin' components. I'm sure
I can work out the answers myself, but it will take a lot of time, so
I'd greatly appreciate it if someone could answer at least these questions:

 * How are external support modules associated with modules generated
   from Widgets.src? If I introduce a new module(s), do I need to modify
   a Makefile, or are the dependencies all auto-detected? In the latter
   case, what do I need to do so that

     option ValidationCommand

   will work in a widget definition, where the ValidationCommand type is
   defined in an external module?

 * What do the prefixes 'builtin_', 'builtina_', 'builtinf_', and
   'builtini_' mean, and why do some of the modules in 'builtin' have
   these prefixes, while others have no prefix?
-- 
Matt Gushee
Englewood, CO, USA


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] LablTk internals
  2005-11-17 21:29 LablTk internals Matt Gushee
@ 2005-11-18  6:00 ` Jun Furuse
  0 siblings, 0 replies; 2+ messages in thread
From: Jun Furuse @ 2005-11-18  6:00 UTC (permalink / raw)
  To: Matt Gushee; +Cc: caml-list

Hi,

>  * How are external support modules associated with modules generated
>    from Widgets.src? If I introduce a new module(s), do I need to modify
>    a Makefile, or are the dependencies all auto-detected? In the latter
>    case, what do I need to do so that
> 
>      option ValidationCommand
>
>    will work in a widget definition, where the ValidationCommand type is
>    defined in an external module?

Dont know... Long long ago we have tried to describe the dependency
information as detailed as possible in Makefiles, and some of them are
automatically created by tkcompiler executed by make. But I forget
this is perfect (i.e. type "make" does all the job) or not. 
I recommend to "make clean all" for sure. It is slow but safe.
  
>  * What do the prefixes 'builtin_', 'builtina_', 'builtinf_', and
>    'builtini_' mean, and why do some of the modules in 'builtin' have
>    these prefixes, while others have no prefix?

Ok, let me look at the source... Well,

builtin* things 
  They are inserted directly into tk.ml by tkcompiler.
  The difference of _, , f_ and i_ indicate where they should go.
  {labltk,camltk}/Makefile.gen:

  builtin: 
	Primitive definition of built-in types which are hard to describe
	inside Widgets.src. Such types are declared as external 
	in Widgets.src. Ex:

	type Index external % builtin_index.ml

  builtini:
	*i*nterface between Tk and Caml for the built-in types,
	for translation of tokens such as cCAMLtoTK* and cTKtoCAML*
	functions.

  builtinf:
	*f*unctioni definitions which are hard to write inside 
	Widgets.src. They will be available inside Tk module, so
	non-widget specific command should come here, such as
	bind command.

  builtina_empty: what's this ? I do not remember... Ignore it. :-)

non builtin* things
  They are usually defines widget class specific functions hard to
  describe in Widgets.src. To be incorporated to the module, these 
  external definition files must be declared using external keyword
  like:

	module Optionmenu {
	  external create "builtin/optionmenu"
        }

  In the above, the function create must be defined inside 
  builtin/optionmenu.ml.	

Best,
--
Jun


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-18  6:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-17 21:29 LablTk internals Matt Gushee
2005-11-18  6:00 ` [Caml-list] " Jun Furuse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).