1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Movable Type 5.2.3" />
8 <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9 <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10 <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml"$>" />
12 <title>Status for Andrew DeFaria: September 30, 2007 - October 6, 2007 Archives</title>
14 <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15 <link rel="prev" href="http://defaria.com/blogs/Status/archives/week_2007_09_23.html" title="September 23, 2007 - September 29, 2007" />
16 <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2007_10_07.html" title="October 7, 2007 - October 13, 2007" />
18 <body class="layout-one-column">
20 <div id="container-inner" class="pkg">
23 <div id="banner-inner" class="pkg">
24 <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
25 <h2 id="banner-description">Searchable status reports and work log</h2>
30 <div id="pagebody-inner" class="pkg">
32 <div id="alpha-inner" class="pkg">
34 <p class="content-nav">
35 <a href="http://defaria.com/blogs/Status/archives/week_2007_09_23.html">« September 23, 2007 - September 29, 2007</a> |
36 <a href="http://defaria.com/blogs/Status/">Main</a>
37 | <a href="http://defaria.com/blogs/Status/archives/week_2007_10_07.html">October 7, 2007 - October 13, 2007 »</a>
42 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
43 xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
44 xmlns:dc="http://purl.org/dc/elements/1.1/">
46 rdf:about="http://defaria.com/blogs/Status/archives/week_2007_09_30.html#entry-000685"
47 trackback:ping="http://defaria.com/mt/mt-tb.cgi/72"
48 dc:title="CreateWOR: Subclassing TextUndo"
49 dc:identifier="http://defaria.com/blogs/Status/archives/week_2007_09_30.html#entry-000685"
50 dc:subject="General Dynamics"
51 dc:description=" Added onChange like callbacks to CreateWOR's text field and text widget. This required subclassing the TextUndo class and properly handling the call back...."
53 dc:date="2007-10-03T11:17:48-06:00" />
58 <h2 class="date-header">October 3, 2007</h2>
60 <div class="entry" id="entry-685">
61 <h3 class="entry-header">CreateWOR: Subclassing TextUndo</h3>
62 <div class="entry-content">
63 <div class="entry-body">
65 <li>Added onChange like callbacks to CreateWOR's text field and text widget. This required subclassing the TextUndo class and properly handling the call back.</li>
68 <h3>Subclassing TextUndo</h3>
70 <p>This is not working exactly as it should. I can't seem to store things like the onChange callback and a scalar representing the contents of the TextUndo widget in the new MyText object. I rely on overriding the methods InsertKeypress, insert, delete and replace in order to trap when modifications are made to the text, changing the $text member and to call the appropriate callback, but the object that's passed in is different than the object as it was in new and member variables for $text and $modified_CB are missing! So instead I use a package global but this means that only one, the same one, $modification_CB is used for all instantiations of MyText and the $text variable doesn't work at all. Instead one must call get_text in the &$modified_CB:</p>
73 # Subclass TextUndo widget to trap and call subroutine when text changes
77 use base qw/Tk::TextUndo/;
79 Construct Tk::Widget "MyText";
88 $modified_CB = delete $parms{-modified} if $parms{-modified};
89 $self->{text} = delete $parms{-text} if $parms{-text};
91 $class->SUPER::new ($self, %parms);
103 $self->SUPER::InsertKeypress (@_);
104 $self->{text} = $self->get ("1.0", "end");
105 &$modified_CB ($self) if $modified_CB;
111 $self->SUPER::insert (@_);
112 $self->{text} = $self->get ("1.0", "end");
118 $self->SUPER::delete (@_);
119 $self->{text} = $self->get ("1.0", "end");
120 &$modified_CB ($self) if $modified_CB;
126 $self->SUPER::replace (@_);
127 $self->{text} = $self->get ("1.0", "end");
128 &$modified_CB ($self) if $modified_CB;
133 <p class="entry-footer">
134 <span class="post-footers">Posted by at 11:17 AM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000685.html">Permalink</a>
136 | <a href="http://defaria.com/blogs/Status/archives/000685.html#trackback">TrackBacks (0)</a>
143 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
144 xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
145 xmlns:dc="http://purl.org/dc/elements/1.1/">
147 rdf:about="http://defaria.com/blogs/Status/archives/week_2007_09_30.html#entry-000684"
148 trackback:ping="http://defaria.com/mt/mt-tb.cgi/71"
150 dc:identifier="http://defaria.com/blogs/Status/archives/week_2007_09_30.html#entry-000684"
151 dc:subject="General Dynamics"
152 dc:description=" Created CreateWOR Perl/Tk application. This will be used by UCMWB Checked in and symlinked the switch config area in /prj/muosran. Investigating other symlinks such that our /prj/muosran area is using what's checked into Clearcase...."
154 dc:date="2007-10-02T11:15:22-06:00" />
159 <h2 class="date-header">October 2, 2007</h2>
161 <div class="entry" id="entry-684">
162 <h3 class="entry-header">CreateWOR</h3>
163 <div class="entry-content">
164 <div class="entry-body">
166 <li>Created CreateWOR Perl/Tk application. This will be used by UCMWB</li>
168 <li>Checked in and symlinked the switch config area in /prj/muosran.</li>
170 <li>Investigating other symlinks such that our /prj/muosran area is using what's checked into Clearcase.</li>
172 <p class="entry-footer">
173 <span class="post-footers">Posted by at 11:15 AM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000684.html">Permalink</a>
175 | <a href="http://defaria.com/blogs/Status/archives/000684.html#trackback">TrackBacks (0)</a>