[LDTP-Dev] setappmap is not working (NameError: name 'setappmap' is not defined()

Premkumar Jothimani prem.jothimani at gmail.com
Wed Nov 9 21:30:23 PST 2005


Hi Mauricio,

Assuming that you use the map file that you sent me, I think your
setcontext() call should look like
setcontext ('PDF Viewer', 'python.pdf')
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.

Regards
Prem

On 11/9/05, Mauricio Lin <mauriciolin at gmail.com> wrote:
>
> Hi Premkumar,
>
> I tried the setcontext() and it is not working, because even I use
> setcontext() the control of window is still in the first window.
>
> Look the snippet of code below:
>
> setcontext('advanced-linux-programming.pdf', 'python.pdf')
> wait(1)
> selectmenuitem('frmadvanced-linux-programming', 'mnuView;mnuZoomIn')
> releasecontext()
>
> 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).
>
> Any idea?
>
> My current solution is to map both windows in a map file.
>
> BR,
>
> Mauricio Lin.
>
> On 11/9/05, Premkumar Jothimani <prem.jothimani at gmail.com> wrote:
> >
> > Hi Mauricio,
> >
> > 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.
> >
> > FYI, the two arguments you have to pass to setcontext are
> > 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.
> > For example, consider you have the following entries in the map file,
> > [frmWindow1]
> > frmWindow1={class=frame,parent="application-name",label="New Window"}
> > In the above case, "New Window" is the string i was referring to as the
> > first parameter
> > ii. The second parameter should be the new label that is present in the
> > title bar of the window at runtime.
> >
> > 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.
> >
> > If you have any clarifications, please let me know, I will do my best to
> > make them straight.
> >
> > Regards
> > Premkumar
> >
> >
> > On 11/9/05, Patrick Gu < Patrick.Gu at sun.com> wrote:
> >
> > > Hi Mauricio,
> > > I didn't try acrobat but I think may be active the window you want by
> > > title(activewin) first and then set a fixed name, such as frmAcrobat
> > > to this window(setcontext). Modify main frame name to frmAcrobat in
> > > map
> > > file.
> > >
> > > -Patrick Gu
> > >
> > >
> > >
> > > Mauricio Lin wrote:
> > >
> > > > Hi Premkumar,
> > > >
> > > > On 11/8/05, *J Premkumar* < jpremkumar at novell.com
> > > > <mailto: jpremkumar at novell.com>> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I would suggest you can use initappmap() itself again. setappmap
> > > > API has
> > > > been removed and apologies for not mentioning it in the API
> > > reference
> > > > page.
> > > >
> > > > I would also suggest you to take a look at remap() API -
> > > > http://gnomebangalore.org/ldtp/index.php/Remap . This would avoid
> > > the
> > > > need for having more than one map file.
> > > >
> > > > If you can explain your
> > > > requirement more clearly, we can discuss on how remap can be made
> > > > use of
> > > > in this situation if possible.
> > > >
> > > >
> > > > OK. I need to open many pdf files and as you should know, gpdf opens
> > > > each pdf file in a separate window, so how can i handle on the
> > > newest
> > > > window?
> > > > If I open 8 pdf files (8 windows), do I have to generate a map file
> > > > (using appmap) with 8 open windows?
> > > >
> > > > BR,
> > > >
> > > > Mauricio Lin.
> > > >
> > >
> > > >------------------------------------------------------------------------
> > > >
> > > >_______________________________________________
> > > >Ldtp-dev mailing list
> > > >Ldtp-dev at lists.freedesktop.org
> > > > http://lists.freedesktop.org/mailman/listinfo/ldtp-dev
> > > >
> > > >
> > >
> > > _______________________________________________
> > > Ldtp-dev mailing list
> > > Ldtp-dev at lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/ldtp-dev
> > >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/ldtp-dev/attachments/20051110/80c2937f/attachment.html


More information about the Ldtp-dev mailing list