<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'><pre>I have a tbsNavBar that I want to put buttons on and be able to disable/enable the rendering of them depending on what component is using the navBar.<br>For example, If I am on the Documentation component, I do not want to show a link to the Documentation component when I am on it.<br><br>In the NavBar, I initialized a couple of dictionaries--one with a selector and the other with a lable to display.<br><br><br><br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>initialize<br>        super initialize.<br>        linkDisplay = Dictionary new.<br>        "enable all links by default"<br>        linkDisplay <br>                at: #signin put: true;<br>                at:  #documentation put: true;<br>                at:  #support put: true;<br>                at:  #signup put: true.<br>        linkLabel = Dictionary new.                <br>        linkLabel <br>                at: #signin put: 'Sign In';<br>                at:  #documentation put: 'Documentation';<br>                at:  #support put: 'Help &amp; Support';<br>                at:  #signup put: 'Sign Up'.<span></span></div></blockquote> <br><span><br>Then on render, I want to invoke a callback with a selector named what the key in the dictionary is so that this:<br><br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>html tbsNavItem: [ html anchor callback: [self signup]; with: 'Sign Up'   ].<br>html tbsNavItem: [ html anchor callback: [self documentation]; with: 'Documentation'   ].<br>html tbsNavItem: [ html anchor callback: [self support]; with: 'Help &amp; Support'].<br>html tbsNavItem: [ html anchor callback: [self signin]; with: 'Sign In']]]<br></div></blockquote> <br>Becomes:<br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>...<br>linkDisplay keysAndValuesDo: [ :key  :value |  value<br>                        ifTrue: [ <br>                                html tbsNavItem: [ html anchor callback: [self key]; with: (linkLabel at: key) ]]....<br></div></blockquote> <br><br>I am getting an error</span><br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>MessageNotUnderstood: MyComponent&gt;&gt;key<span></span></div></blockquote> <br><span>Does anybody have a generic way to dynamically set a callback to a selector?<br><br>thx in advance<br></span></pre></div></body></html>