Re: Help with _zvt term match_add

>  Hi,
> I really need help with this one since it is driving me crazy!
> How the heck does it work. In pygnome it asks for a regex (this is=20
> fine by me) and then a highlight mask, but nowhere in this universe=20
> does it say what this means? I looked through gnome docs, used emacs=20
> to search for highlight in all pygnome pygtk modules to no avail.
> All I could learn is that it needs numbers (why though?)

>From the MANUAL:

"Add a new auto-match regular expression. The zvt_term_match_check()
function can be used to check for matches using screen coordinates. 

Each regular expression regex will be matched against each line in the
visible buffer. 

The highlight_mask is taken from the VTATTR_* bits, as defined in
vt.h. These include VTATTR_BOLD, VTATTR_UNDERLINE, etc, but not the

These are the relevant bitmasks:

#define VTATTR_BOLD       0x40000000
#define VTATTR_UNDERLINE  0x20000000
#define VTATTR_REVERSE    0x08000000

It can also be 0, in which case you get no visual indication apart
from the pointing hand.

> I also learned that if you do a match_add('def', 1) for instance, in=20
> your terminal app your cursor will become a small hand that points,=20
> like in html.

There should definetly be a third argument to the function.  That
is how you reference your regular experssions when a match occurs.

> Now, how can I use this nifty hand to actually enable anyone to CLICK=20
> IT and thus make it do something!

You have to check the click yourself.  zvt will just render it and
change the mouse pointer appropriately.

Check zvt_term_match_check from that same page above.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]