A new-to-Linux friend of mine pointed out the lack of a "Find"
button in gnome-help-browser. He was right, it is not easy to
find a particular man entry page for example, without spending
30 seconds scrolling the man page listing.

So for fun I decided I would add a Find button.  I spent a few
hours studying the gnome-core/help-browser sources, and took
a brief look at gnome-core/gtk-xmhtml.  I added the "Find" 
button and a stub callback, but for the implementation
I'm a little stuck.

In /usr/include/gtk-xmhtml/XmHTML.h I found,

  extern XmHTMLPosition XmHTMLTextFindString(TWidget w, String to_find,
  		         XmHTMLDirection dir, XmHTMLPosition curr_pos);

Looks like what I need, but there are a few issues:
1) This function is not implemented.
2) XmHTMLPosition is noted as being a "fully opaque type" (actually
   a "struct _XmHTMLObjectTable *").  To pass the curr_pos argument above, 
   it will need at least *one* typedef or enum to feed it the first
   time (if it is to remain an opaque type).
3) Since XmHTMLTextFindString() returns an XmHTMLPosition, I was 
   thinking of writing "int XmHTMLPositionToLine()" call to return a 
   value suitable for gtk_xmhtml_set_topline().

Am I missing anything?  Anyone else already worked on this?
If not, I will try filling this stuff in.


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