git-commit-vandalism/lib
Shawn O. Pearce 6233ab1729 git-gui: Teach class system to support [$this cmd] syntax
Its handy to be able to ask an object to do something for you by
handing it a subcommand.  For example if we want to get the value
of an object's private field the object could expose a method that
would return that value.  Application level code can then invoke
"$inst get" to perform the method call.

Tk uses this pattern for all of its widgets, so we'd certainly
like to use it for our own mega-widgets that we might develop.
Up until now we haven't needed such functionality, but I'm working
on a new revision picker mega-widget that would benefit from it.

To make this work we have to change the definition of $this to
actually be a procedure within the namespace.  By making $this a
procedure any caller that has $this can call subcommands by passing
them as the first argument to $this.  That subcommand then needs
to call the proper subroutine.

Placing the dispatch procedure into the object's variable namespace
ensures that it will always be deleted when the object is deleted.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-08 21:12:45 -04:00
..
blame.tcl Merge branch 'maint' 2007-07-08 21:10:03 -04:00
branch_rename.tcl Merge branch 'maint' 2007-06-11 23:58:11 -04:00
branch.tcl git-gui: Allow creating a branch when none exists 2007-05-30 19:34:40 -04:00
browser.tcl git-gui: Save geometry before the window layout is damaged 2007-06-11 23:52:43 -04:00
class.tcl git-gui: Teach class system to support [$this cmd] syntax 2007-07-08 21:12:45 -04:00
commit.tcl git-gui: Honor rerere.enabled configuration option 2007-07-08 17:41:24 -04:00
console.tcl git-gui: Save geometry before the window layout is damaged 2007-06-11 23:52:43 -04:00
database.tcl git-gui: Convert browser, console to "class" format 2007-05-08 21:38:54 -04:00
diff.tcl git-gui: Allow as few as 0 lines of diff context 2007-05-31 23:32:54 -04:00
error.tcl git-gui: Refactor into multiple files to save my sanity 2007-05-07 23:35:48 -04:00
index.tcl git-gui: Refactor into multiple files to save my sanity 2007-05-07 23:35:48 -04:00
merge.tcl git-gui: Unlock the index when cancelling merge dialog 2007-07-04 02:29:32 -04:00
option.tcl Merge branch 'maint' 2007-06-11 02:14:21 -04:00
remote_branch_delete.tcl git-gui: Correct resizing of remote branch delete dialog 2007-07-04 23:16:20 -04:00
remote.tcl git-gui: GUI support for running 'git remote prune <name>' 2007-05-28 17:50:40 -04:00
shortcut.tcl git-gui: Ensure windows shortcuts always have .bat extension 2007-07-06 04:02:18 -04:00
transport.tcl git-gui: GUI support for running 'git remote prune <name>' 2007-05-28 17:50:40 -04:00