Hi Mauricio,<br>
<br>
Assuming that you use the map file that you sent me, I think your setcontext() call should look like<br>
setcontext ('PDF Viewer', 'python.pdf')<br>The
point to note here is that the first parameter should always be the
value of the "label" field for that window name in the map file.<br>
<br>
Regards<br>
Prem<br>
<br><div><span class="gmail_quote">On 11/9/05, <b class="gmail_sendername">Mauricio Lin</b> <<a href="mailto:mauriciolin@gmail.com">mauriciolin@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Premkumar,<br><br>
I tried the setcontext() and it is not working, because even I use
setcontext() the control of window is still in the first window.<br>
<br>
Look the snippet of code below:<br>
<br>
setcontext('advanced-linux-programming.pdf', 'python.pdf')<br>
wait(1)<br>
selectmenuitem('frmadvanced-linux-programming', 'mnuView;mnuZoomIn')<br>
releasecontext()<br>
<br>
The selectmenuitem() keeps selecting the menu item of first window
(with title advanced-linux-programming.pdf ). It is not changing the
control to the second one (with title python.pdf).<br>
<br>
Any idea?<br>
<br>
My current solution is to map both windows in a map file.<br>
<br>
BR,<br><span class="sg">
<br>
Mauricio Lin.</span><div><span class="e" id="q_107759a0579bca50_2"><br>
<br><div><span class="gmail_quote">On 11/9/05, <b class="gmail_sendername">Premkumar Jothimani</b> <<a href="mailto:prem.jothimani@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">prem.jothimani@gmail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Mauricio,<br>
<br>
I feel setcontext () API can be made use of in this situation. Though
each file is opened in a separate window, the map of the window is
going to be common. Hence you can use setcontext() to select windows
based on the label.<br>
<br>
FYI, the two arguments you have to pass to setcontext are<br>
i. the first parameter is the value corresponding to the
attribute "label" present in the map file in the entry corresponding to
the name of the window itself.<br>
For example, consider you have the following entries in the map file, <br>
[frmWindow1]<br>
frmWindow1={class=frame,parent="application-name",label="New Window"}<br>
In the above case, "New Window" is the string i was referring to as the first parameter<br>
ii. The second parameter should be the new label that is present in the title bar of the window at runtime.<br>
<br>
The basic idea is to have a single map file, and then use setcontext()
to select the required window among all the available windows based on
its current label. Please make sure to do releasecontext() after every
setcontext() usage.<br>
<br>
If you have any clarifications, please let me know, I will do my best to make them straight.<br>
<br>
Regards<br><span>
Premkumar<br>
<br>
<br></span><div><div><span><span class="gmail_quote">On 11/9/05, <b class="gmail_sendername">Patrick Gu</b> <<a href="mailto:Patrick.Gu@sun.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Patrick.Gu@sun.com</a>> wrote:</span></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span>
Hi Mauricio,<br>I didn't try acrobat but I think may be active the window you want by<br>title(activewin) first and then set a fixed name, such as frmAcrobat<br>to this window(setcontext). Modify main frame name to frmAcrobat in map
<br>file.<br><br>-Patrick Gu<br><br><br><br>Mauricio Lin wrote:<br><br>> Hi Premkumar,<br>><br>> On 11/8/05, *J Premkumar* <<a href="mailto:jpremkumar@novell.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
jpremkumar@novell.com</a><br>> <mailto:<a href="mailto:jpremkumar@novell.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
jpremkumar@novell.com</a>>> wrote:<br>><br>> Hi,<br>><br>> I would suggest you can use initappmap() itself again. setappmap<br>> API has<br>> been removed and apologies for not mentioning it in the API reference
<br>> page.<br>><br>> I would also suggest you to take a look at remap() API -<br>> <a href="http://gnomebangalore.org/ldtp/index.php/Remap" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://gnomebangalore.org/ldtp/index.php/Remap</a> . This would avoid the
<br>> need for having more than one map file.<br>><br>> If you can explain your<br>> requirement more clearly, we can discuss on how remap can be made<br>> use of<br>> in this situation if possible.
<br>><br>><br>> OK. I need to open many pdf files and as you should know, gpdf opens<br>> each pdf file in a separate window, so how can i handle on the newest<br>> window?<br>> If I open 8 pdf files (8 windows), do I have to generate a map file
<br>> (using appmap) with 8 open windows?<br>><br>> BR,<br>><br>> Mauricio Lin.<br>><br>>------------------------------------------------------------------------<br>><br>>_______________________________________________
<br>>Ldtp-dev mailing list<br>><a href="mailto:Ldtp-dev@lists.freedesktop.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Ldtp-dev@lists.freedesktop.org</a><br>><a href="http://lists.freedesktop.org/mailman/listinfo/ldtp-dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.freedesktop.org/mailman/listinfo/ldtp-dev
</a><br>><br>><br><br></span></div>_______________________________________________<span><br>Ldtp-dev mailing list<br><a href="mailto:Ldtp-dev@lists.freedesktop.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Ldtp-dev@lists.freedesktop.org</a><br><a href="http://lists.freedesktop.org/mailman/listinfo/ldtp-dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.freedesktop.org/mailman/listinfo/ldtp-dev</a><br></span></blockquote></div><br>
</blockquote></div><br>
</span></div></blockquote></div><br>