Loading ...
Sorry, an error occurred while loading the content.

ANN: Snit V0.6

Expand Messages
  • Will Duquette
    Snit s Not Incr Tcl V0.6 ... Snit is pure-Tcl object and megawidget framework. It is now available at http://www.wjduquette.com/snit; see snit.html in the
    Message 1 of 1 , Oct 23, 2002
    View Source
    • 0 Attachment
      Snit's Not Incr Tcl V0.6
      -----------------------------------------------------------------

      Snit is pure-Tcl object and megawidget framework. It is now
      available at http://www.wjduquette.com/snit; see snit.html
      in the distribution or at the URL above for full details.

      If you have any questions, bug reports, suggestions, or comments,
      feel free to contact me, Will Duquette, at will@...; or,
      join the Snit mailing list (see http://www.wjduquette.com/snit for
      details).

      Changes since V0.5
      -----------------------------------------------------------------

      * Major rewrite of the man page.

      * The command snit::widgettype is deprecated, in favor of
      snit::widget.

      * The variable "type" is now automatically defined in all methods,
      constructors, destructors, typemethods, onconfigure handlers, and
      oncget handlers. Thus, a method can call type methods as "$type
      methodname".

      * The new standard instance method "info" is used for introspection on
      type and widget instances:

      $object info type
      Returns the object's type.

      $object info vars
      Returns a list of the object's instance variables (excluding Snit
      internal variables). The names are fully qualified.

      $object info typevars
      Returns a list of the object's type's type variables (excluding
      Snit internal variables). The names are fully qualified.

      $object info options
      Returns a list of the object's option names. This always
      includes local options and explicitly delegated options. If
      unknown options are delegated as well, and if the component to
      which they are delegated responds to "$object configure" like Tk
      widgets do, then the result will include all possible unknown
      options which could be delegated to the component.

      Note that the return value might be different for different
      instances of the same type, if component object types can vary
      from one instance to another.

      * The new standard typemethod "info" is used for introspection on
      types:

      $type info typevars
      Returns a list of the type's type variables (excluding Snit
      internal variables).

      $type info instances
      Returns a list of the instances of the type. For non-widget
      types, each instance will be the fully-qualified instance command
      name; for widget types, each instance will be a widget name.

      * Bug fixed: great confusion resulted if the hull component of a
      snit::widgettype was another snit::widgettype. Snit takes over the
      hull widget's Tk widget command by renaming it to a known name, and
      putting its own command in its place. The code made no allowance
      for the fact that this might happen more than once; the second time,
      the original Tk widget command would be lost. Snit now ensures that
      the renamed widget command is given a unique name.

      * Previously, instance methods could call typemethods by name, as
      though they were normal procs. The downside to this was that
      if a typemethod name was the same as a standard Tcl command, the
      typemethod shadowed the standard command in all of the object's
      code. This is extremely annoying should you wish to define a
      typemethod called "set". Instance methods must now call typemethods
      using the type's command, as in "$type methodname".

      * Typevariable declarations are no longer required in
      typemethods, methods, or procs provided that the typevariables
      are defined in the main type or widget definition.

      * Instance variable declarations are no longer required in methods
      provided that the instance variables are defined in the main type
      or widget declaration.

      * Instance variable declarations are no longer required in procs,
      provided that the instance variables are defined in the main type or
      widget declaration. Any proc that includes "self" in its argument
      list will pick up all such instance variables automatically.

      * The "configure" method now returns output consistent with Tk's when
      called with 0 or 1 arguments, i.e., it returns information about one
      or all options. For options defined by Snit objects, the "dbname"
      and "classname" returned in the output will be {}. "configure" does
      its best to do the right thing in the face of delegation.

      * If the string "%AUTO%" appears in the "name" argument to "$type
      create" or "$widgettype create", it will be replaced with a string
      that looks like "$type$n", where "$type" is the type name and
      "$n" is a counter that's incremented each time a widget of this
      type is created. This allows the caller to create effectively
      anonymous instances:

      widget mylabel {...}

      set w [mylabel .pane.toolbar.%AUTO% ...]
      $w configure -text "Some text"

      * The "create" typemethod is now optional for ordinary types so long
      as the desired instance name is different than any typemethod name
      for that type. Thus, the following code creates two dogs, ::spot
      and ::fido.

      type dog {...}

      dog create spot
      dog fido

      If there's a conflict between the instance name and a typemethod,
      either use "create" explicitly, or fully qualify the instance name:

      dog info -color black ;# Error; assumes "info" typemethod.
      dog create info -color black ;# OK
      dog ::info -color black ;# also OK

      * Bug fix: If any Snit method, typemethod, constructor, or onconfigure
      handler defines an explicit argument called "type" or "self", the
      type definition now throws an error, preventing confusing runtime
      behavior.

      * Bug fix: If a Snit type or widget definition attempts to define a
      method or option locally and also delegate it to a component, the
      type definition now throws an error, preventing confusing runtime
      behavior.

      * Bug(?) Fix: Previously, the "$self" command couldn't be used in
      snit::widget constructors until after the hull component was
      defined. It is now possible to use the "$self" command to call
      instance methods at any point in the snit::widget's
      constructor--always bearing in mind that it's an error to configure
      delegated options or are call delegated methods before creating the
      component to which they are delegated.


      [[Send Tcl/Tk announcements to tcl-announce@...
      Announcements archived at http://groups.yahoo.com/group/tcl_announce/
      Send administrivia to tcl-announce-request@...
      Tcl/Tk at http://tcl.tk/ ]]
    Your message has been successfully submitted and would be delivered to recipients shortly.