<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-9003103274808968548.post2445173949195323757..comments</id><updated>2010-01-22T13:29:53.715-08:00</updated><category term='Coding'/><category term='Python'/><category term='Blogger tips and hacks'/><category term='System Administration'/><category term='C'/><category term='Troubleshooting'/><category term='Sun systems'/><category term='Shell Programming'/><category term='ssh'/><category term='XML'/><category term='About this blog'/><category term='Useful tools'/><category term='Windows'/><category term='Howtos'/><category term='Search'/><category term='Java'/><category term='Algorithms'/><category term='Page Rank'/><category term='openoffice'/><category term='GUI'/><category term='Technical Articles'/><category term='SWIG'/><category term='Netbeans'/><category term='Stanford'/><category term='Sun'/><category term='Sun Technologies for Students'/><category term='Investment Science'/><category term='General'/><category term='Jython'/><category term='Linux'/><category term='Socket Programming'/><category term='My Bookshelf'/><category term='Solaris'/><category term='Certifications'/><category term='VNC'/><category term='Hacking'/><title type='text'>Comments on Techtalks: Python Tkinter OptionMenu: Changing, deleting, add...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.prasannatech.net/feeds/2445173949195323757/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9003103274808968548/2445173949195323757/comments/default'/><link rel='alternate' type='text/html' href='http://www.prasannatech.net/2009/06/tkinter-optionmenu-changing-choices.html'/><author><name>Prasanna Seshadri</name><uri>http://www.blogger.com/profile/02028881738236321272</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9003103274808968548.post-3954218627546729841</id><published>2010-01-22T13:29:53.715-08:00</published><updated>2010-01-22T13:29:53.715-08:00</updated><title type='text'>Prasanna, as a quick fix, I decided to set the men...</title><content type='html'>Prasanna, as a quick fix, I decided to set the menu item&amp;#39;s command to the function that I wanted to be called when the user changes selections with the OptionMenu, and then put the line to set the dropdown&amp;#39;s text in that function that is called. E.g.&lt;br /&gt;&lt;br /&gt;def optionMenuChanged(event):&lt;br /&gt;    optionMenuWidget.setvar(unitNo_dropdown.cget(&amp;quot;textvariable&amp;quot;), value = event)&lt;br /&gt;#code to do what I originally wanted to do when the OptionMenu was changed&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;optionMenuWidget[&amp;#39;menu&amp;#39;].add_command(label=myLabel, command=lambda temp=myLabel: unitNameChange(temp))&lt;br /&gt;&lt;br /&gt;(I hope that code shows up legibly in the comments section!) Anyway, not the most elegant solution in the world, but it does what it needs to. Still, perhaps you can think of a better way.  I also found Python MegaWidgets in my search for a solution, and though I haven&amp;#39;t tried them out yet, it looks like the Pmw.ComboBox() might be a nice way to do it.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9003103274808968548/2445173949195323757/comments/default/3954218627546729841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9003103274808968548/2445173949195323757/comments/default/3954218627546729841'/><link rel='alternate' type='text/html' href='http://www.prasannatech.net/2009/06/tkinter-optionmenu-changing-choices.html?showComment=1264195793715#c3954218627546729841' title=''/><author><name>Michael</name><uri>http://www.blogger.com/profile/07332951951432252966</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.prasannatech.net/2009/06/tkinter-optionmenu-changing-choices.html' ref='tag:blogger.com,1999:blog-9003103274808968548.post-2445173949195323757' source='http://www.blogger.com/feeds/9003103274808968548/posts/default/2445173949195323757' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-536635339'/></entry><entry><id>tag:blogger.com,1999:blog-9003103274808968548.post-808457271119645324</id><published>2010-01-22T13:25:53.462-08:00</published><updated>2010-01-22T13:25:53.462-08:00</updated><title type='text'></title><content type='html'>This comment has been removed by the author.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9003103274808968548/2445173949195323757/comments/default/808457271119645324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9003103274808968548/2445173949195323757/comments/default/808457271119645324'/><author><name>Michael</name><uri>http://www.blogger.com/profile/07332951951432252966</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.prasannatech.net/2009/06/tkinter-optionmenu-changing-choices.html' ref='tag:blogger.com,1999:blog-9003103274808968548.post-2445173949195323757' source='http://www.blogger.com/feeds/9003103274808968548/posts/default/2445173949195323757' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.contentRemoved' value='true'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-536635339'/></entry><entry><id>tag:blogger.com,1999:blog-9003103274808968548.post-8327235461693499236</id><published>2010-01-22T10:06:49.458-08:00</published><updated>2010-01-22T10:06:49.458-08:00</updated><title type='text'>Thanks Michael for the comments, thats a good ques...</title><content type='html'>Thanks Michael for the comments, thats a good question you asked, I will respond once I find a solution.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9003103274808968548/2445173949195323757/comments/default/8327235461693499236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9003103274808968548/2445173949195323757/comments/default/8327235461693499236'/><link rel='alternate' type='text/html' href='http://www.prasannatech.net/2009/06/tkinter-optionmenu-changing-choices.html?showComment=1264183609458#c8327235461693499236' title=''/><author><name>Prasanna Seshadri</name><uri>http://www.blogger.com/profile/02028881738236321272</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.prasannatech.net/2009/06/tkinter-optionmenu-changing-choices.html' ref='tag:blogger.com,1999:blog-9003103274808968548.post-2445173949195323757' source='http://www.blogger.com/feeds/9003103274808968548/posts/default/2445173949195323757' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1945045701'/></entry><entry><id>tag:blogger.com,1999:blog-9003103274808968548.post-7069453676318447143</id><published>2010-01-21T22:14:43.914-08:00</published><updated>2010-01-21T22:14:43.914-08:00</updated><title type='text'>Great post.  This is exactly what I&amp;#39;m looking ...</title><content type='html'>Great post.  This is exactly what I&amp;#39;m looking for, except for one thing -- as far as I can tell, when you make the OptionMenu choices &amp;#39;on the fly&amp;#39; the way you did, you lose the ability to set the OptionMenu&amp;#39;s command.  It is used up by the lambda function that changes the text of the OptionMenu.  I wanted to also have a different function called whenever the user selected something with the OptionMenu, but I can&amp;#39;t figure out how to do so.  Any ideas?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9003103274808968548/2445173949195323757/comments/default/7069453676318447143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9003103274808968548/2445173949195323757/comments/default/7069453676318447143'/><link rel='alternate' type='text/html' href='http://www.prasannatech.net/2009/06/tkinter-optionmenu-changing-choices.html?showComment=1264140883914#c7069453676318447143' title=''/><author><name>Michael</name><uri>http://www.blogger.com/profile/07332951951432252966</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.prasannatech.net/2009/06/tkinter-optionmenu-changing-choices.html' ref='tag:blogger.com,1999:blog-9003103274808968548.post-2445173949195323757' source='http://www.blogger.com/feeds/9003103274808968548/posts/default/2445173949195323757' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-536635339'/></entry></feed>
