Hi Scott,<br><br>Apologize for my delayed response.<br><br><div class="gmail_quote">On Wed, Oct 14, 2009 at 6:57 AM, Wang Qi, Scott <span dir="ltr">&lt;<a href="mailto:wangqi.s@gmail.com">wangqi.s@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi, Nagappan,<br><br>I tried your method. Both work great.<br><br>But I found another interesting issue. For the APP I am testing, the state of the menu item such as SENSITIVE is updated in a <span>wx.EVT_UPDATE_UI event. I think different UI framework get different name. But the basic mechanism should work the same. The state of menu item only changes when user click on the root menu. For example, I must try to manually click on &#39;mnuFile&#39; to show the menu list to make the state of &#39;mnuFile;mnuClose&#39; get change (updated in the wx.EVT_UPDATE_UI event handler).<br>

</span></blockquote><div><br>In LDTP, we restricted clicking mnuFile due to bug in accessibility.<br><br><a href="http://cgit.freedesktop.org/ldtp/ldtp/tree/src/menu.c#n38">http://cgit.freedesktop.org/ldtp/ldtp/tree/src/menu.c#n38</a><br>

<br>Unfortunately this bug still exist, verified with v2.<br><br>Thanks<br>Nagappan <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<span>

<br></span><span>So my question is how to trigger this wx.EVT_UPDATE_UI event in the test script? I tried ldtp.selectmenuitem(win_name, &#39;mnuFile&#39;). This call does not do the same thing as what a manual click on &#39;mnuFile&#39; item does, which trigger the EVT_UPATE_UI event.<br>



<br>Thanks<br>Scott<br>
</span><br><span>P.S: I tried gedit and find the state of menu item is updated instantly. For example, the SENSITIVE state of &#39;mnuFile;mnuClose&#39; will change to off as soon as the last edit tab is closed in gedit.<br>



<br><br></span>
<div class="gmail_quote">On Fri, Sep 25, 2009 at 10:28 AM, Nagappan A <span dir="ltr">&lt;<a href="mailto:nalagappan@vmware.com" target="_blank">nalagappan@vmware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



Hi Scott,<br>
<br>
You can check with:<br>
<br>
1. hasstate(&#39;window&#39;, &#39;object&#39;, state.ENABLED)<br>
2. getallstates, from return value of it you can check:<br>
    enabled = False<br>
    for currentState in states:<br>
       if state.ENABLED == currentState:<br>
          print &#39;Enabled&#39;<br>
          enabled = True<br>
          break<br>
<br>
In case of menu state.SENSITIVE will be checked.<br>
<br>
Thanks<br>
Nagappan<div><div></div><div><br>
<br>
Wang Qi, Scott wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, Nagappan,<br>
<br>
It seems ldtp.getallstates() return an array of integer. I look in the online doc about how to use the index. Seems there is no information on it.<br>
<br>
Also, how to tell if a mnu is enabled or not? Seems button&#39; state can be get by calling stateenabled (). But stateenabled() will always return 0 for mnu?<br>
<br>
Thanks<br>
Scott Wang<br>
<br>
<br>
</blockquote>
<br></div></div><font color="#888888">
-- <br>
Linux Desktop Testing Project - <a href="http://ldtp.freedesktop.org" target="_blank">http://ldtp.freedesktop.org</a><br>
<a href="http://nagappanal.blogspot.com" target="_blank">http://nagappanal.blogspot.com</a><br>
<br>
</font></blockquote></div><br>
<br>_______________________________________________<br>
LDTP-dev mailing list<br>
<a href="mailto:LDTP-dev@lists.freedesktop.org">LDTP-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/ldtp-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/ldtp-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Linux Desktop (GUI Application) Testing Project - <a href="http://ldtp.freedesktop.org">http://ldtp.freedesktop.org</a><br><a href="http://nagappanal.blogspot.com">http://nagappanal.blogspot.com</a><br>