<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Elisabeth,<div><span class="Apple-tab-span" style="white-space:pre"> </span>As Tom says, the code he refers to is really more complex than you need. Just do this:</div><div><br></div><div>from chimera.tkgui import addMenu</div><div>myMenu = addMenu(label="menu name")</div><div><br></div><div>to create a top-level menu that you can add items to. An example of its use in Chimera itself is in the _getAliasMenu() function in Midas/midas_text.py.</div><div><br></div><div>--Eric</div><br><div><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> Eric Pettersen</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> UCSF Computer Graphics Lab</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> <a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></div></div></span></div><div><br><div><div>On Jan 21, 2011, at 9:20 AM, Tom Goddard wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div> Hi Elisabeth,<br><br> There is some code in Chimera that makes a new top-level menu called <br>Volume that is a copy of the Tools / Volume Data submenu. That Volume <br>menu is displayed using menu entry Tools / Volume Data / Volume Menu on <br>Menubar and if you show it it is remembered in the Chimera preferences <br>file so it will appear every time you run Chimera. This is a more <br>complex than you need. But the main routine that would be useful to <br>study is called create_toplevel_volume_menu() in file<br><br> chimera / share / VolumeMenu / __init__.py<br><br>in your Chimera distribution. It would be easy to make a similar <br>Chimera extension that made a toplevel Scripts menu and simply read all <br>the files in one of your directories and made menu entries which caused <br>the file to be opened in Chimera. If you need more help with writing it <br>ask.<br><br> Tom<br><br><br><blockquote type="cite">Dear Chimera Dev Team,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'm trying to put other option in the menu bar (File, Select, Actions, <br></blockquote><blockquote type="cite">... , myOption, Help) to store my own scripts. I'm doing a deep search <br></blockquote><blockquote type="cite">on your python and C++ codes but I don't find which is the code that I <br></blockquote><blockquote type="cite">have to modify.<br></blockquote><blockquote type="cite">I know that is easy to store my scripts in the Tools menu, but I <br></blockquote><blockquote type="cite">prefer to put my scripts in a new option of the menu bar.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks a lot for taking the time to reply.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Elisabeth Ortega<br></blockquote><blockquote type="cite">Autonomous University of Barcelona (UAB)<br></blockquote><br>_______________________________________________<br>Chimera-dev mailing list<br><a href="mailto:Chimera-dev@cgl.ucsf.edu">Chimera-dev@cgl.ucsf.edu</a><br>http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev<br></div></blockquote></div><br></div><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="font-size: medium;"><br></span><br class="Apple-interchange-newline"></div></span> </div><br></body></html>