<div dir="ltr">I found a better way to handle the tab key for moving focus between text inputs.<div>Rather than modify InnerTextMorph or TextModelMorph, I did the following:<div><br></div><div>- Created a subclass of InnerTextMorph named InnerTextNoTabMorph.</div><div> This overrides the processKeystrokeEvent: method to be the same as in InnerTextMorph except it does not process tab key events.</div><div> I also added an onChange: method that takes a block that it evaluates every time it processes a key event.</div><div><br></div><div>- Created a subclass of TextModelMorph named TextInputMorph.</div><div> This has an initialize method that sets up event handling to handle tab key presses and move focus appropriately.</div><div> It implements the innerMorphClass method to indicate that it wants to use InnerTextNoTabMorph instead of InnerTextMorph.</div><div> It implements the onChange: method to forward a block onto the same method in InnerTextNoMorph.</div><div><br></div><div>With these classes in place, my Greeter class uses TextInputMorph in place of TextModelMorph</div><div>and voila tabbing between text inputs works great!</div><div><br></div><div>You can find all this code at <a href="https://github.com/mvolkmann/Cuis-Smalltalk-Greeter">https://github.com/mvolkmann/Cuis-Smalltalk-Greeter</a>.</div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Jan 29, 2025 at 9:32 AM Hilaire Fernandes via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u>
<div bgcolor="#FFFFFF">
<p><font size="4">That would be neat. But a Tab option in
TextModelMorph may prove to be more useful for Widget as in
Cuis-Smalltalk-UI.</font><br>
</p>
<div>Le 28/01/2025 à 22:06, Mark Volkmann
via Cuis-dev a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">Thanks Juan! I'll see if maybe I can create a
subclass of TextModelMorph that has that behavior. Perhaps each
instance of the subclass can hold a reference to another morph
that should take focus when the tab key is pressed. Maybe I can
create a set of morphs that have that ability such as
checkboxes, radio buttons, and so on. That would enable creating
user interfaces that are completely keyboard-driven as is common
in web interfaces.</div>
</blockquote>
<pre cols="72">--
<a href="http://mamot.fr/@drgeo" target="_blank">http://mamot.fr/@drgeo</a></pre>
</div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div>