[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Oct 14 13:08:33 1993 
Subject:callback call data problem 
From:Andrew Casson 
Volume-ID:931015.10 


Hi,

I'm experimenting with using xmosaic's HTML widget from Pop11 and I'm
having a problem with anchor callbacks.

The widget documentation says this:

    WbAnchorCallbackData
        The structure pointed to by the call_data portion of an
        anchorCallback. Contains the event that generated the callback,
        the page of the document currently displayed, the unique element
        ID of the anchor activated, the text of the anchor activated,
        and the HREF field of the anchor activated.

        typedef struct acall_rec {
            XEvent *event;
            int page;
            int element_id;
            char *text;
            char *href;
        } WbAnchorCallbackData;

So I've defined a typespec as follows:

    include xpt_xevent.ph;

    p_typespec WbAnchorCallbackData {
        event :XEvent,
        page :int,
        element_id :int,
        text :XptString,
        href :XptString,
    };

which I'm trying to use like this:

    define AnchorCallback(w, client, call);
        lvars w, client, call;
        exacc:WbAnchorCallbackData call.text =>
        exacc:WbAnchorCallbackData call.href =>
    enddefine;

    XtAddCallback(w, XtN anchorCallback, AnchorCallback, 0);

where -w- is an HTML widget. However, when I create a widget and
click on an anchor, the text and href values I get, though they
*are* strings, do not have the expected contents (in fact they are
invariably '' and '\(159)\(192)\(64)'.

Is there something I'm not doing, or doing wrong?

Andrew

P.S. after looking at some of the stuff in $usepop/pop/x/pop/lib/Xol, I tried
    using :ntstring_ptr instead of :XptString --- and got the same result.


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Andrew Casson, AIAI, University of Edinburgh            andrewc@aiai.ed.ac.uk
                                                                 031-650 2746
"Am fear a bhios fad aig an asaig gheabh e thairis uaireigin"
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=