Hi Mauricio,<br>
<br>
Assuming that you use the map file that you sent me, I think your setcontext() call should look like<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setcontext ('PDF Viewer', 'python.pdf')<br>The
point to note here is that the first parameter should always be the
value of the &quot;label&quot; 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> &lt;<a href="mailto:mauriciolin@gmail.com">mauriciolin@gmail.com</a>&gt; 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> &lt;<a href="mailto:prem.jothimani@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">prem.jothimani@gmail.com
</a>&gt; 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>
&nbsp;&nbsp; i. the first parameter is the value corresponding to the
attribute &quot;label&quot; present in the map file in the entry corresponding to
the name of the window itself.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For example, consider you have the following entries in&nbsp; the map file, <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frmWindow1]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
frmWindow1={class=frame,parent=&quot;application-name&quot;,label=&quot;New Window&quot;}<br>
&nbsp;&nbsp;&nbsp;&nbsp; In the above case, &quot;New Window&quot; is the string i was referring to as the first parameter<br>
&nbsp;&nbsp; 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>
&nbsp;<br></span><div><div><span><span class="gmail_quote">On 11/9/05, <b class="gmail_sendername">Patrick Gu</b> &lt;<a href="mailto:Patrick.Gu@sun.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

Patrick.Gu@sun.com</a>&gt; 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).&nbsp;&nbsp;Modify main frame name to frmAcrobat in map
<br>file.<br><br>-Patrick Gu<br><br><br><br>Mauricio Lin wrote:<br><br>&gt; Hi Premkumar,<br>&gt;<br>&gt; On 11/8/05, *J Premkumar* &lt;<a href="mailto:jpremkumar@novell.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

jpremkumar@novell.com</a><br>&gt; &lt;mailto:<a href="mailto:jpremkumar@novell.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
jpremkumar@novell.com</a>&gt;&gt; wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Hi,<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I would suggest you can use initappmap() itself again. setappmap<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; API has<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; been removed and apologies for not mentioning it in the API reference
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; page.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I would also suggest you to take a look at remap() API -<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <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>&gt;&nbsp;&nbsp;&nbsp;&nbsp; need for having more than one map file.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; If you can explain your<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; requirement more clearly, we can discuss on how remap can be made<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; use of<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; in this situation if possible.
<br>&gt;<br>&gt;<br>&gt; OK. I need to open many pdf files and as you should know, gpdf opens<br>&gt; each pdf file in a separate window, so how can i handle on the newest<br>&gt; window?<br>&gt; If I open 8 pdf files (8 windows), do I have to generate a map file
<br>&gt; (using appmap) with 8 open windows?<br>&gt;<br>&gt; BR,<br>&gt;<br>&gt; Mauricio Lin.<br>&gt;<br>&gt;------------------------------------------------------------------------<br>&gt;<br>&gt;_______________________________________________
<br>&gt;Ldtp-dev mailing list<br>&gt;<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>&gt;<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>&gt;<br>&gt;<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>