Hi, On Fri, Mar 19, 2010 at 10:26:25AM +0530, Rajesh Marathe wrote:
Hi,
I am trying to implement the support for using the tab or other keyboard keys to set focus on web page links. As part of this, I started out with adding a new Class and would like to use some sort of iterator in this class. I would also like to use the 'Textblock' object to retrieve the style->x_link for a word. However, when I try to initialize the Textblock object in my new class, I get a linker error. The details are as under:
The basic skeletal code for new class is: ======================================== findlinks.cc
namespace dw { namespace core {
FindLinks::FindLinks () { widget = NULL; iterator = NULL;
}
FindLinks::~FindLinks () { if (iterator) delete iterator; }
void FindLinks::getlink (void) { MSG("\n Hi !! I came to findlinks"); Textblock *textblock = new Textblock (false);
}
I have included "dw/textblock.hh" in the above file and also included core.hh.
I guess it's because Textblock is in the dw namespace, not dw::core, so removing "namespace core {" in the above example should fix it. Alternatively you could use "new dw::Textblock (false);".
Compilation goes through but I end up with a linker error as under: ===================================================================== ../dw/libDw-core.a(findlinks.o): In function `dw::core::FindLinks::getlink()': /home/rmarathe/dillo-2.2/dw/findlinks.cc:25: undefined reference to `dw::Textblock::Textblock(bool)' collect2: ld returned 1 exit status
I believe that I still need to use "iterator" and the Textblock" classes to implement this feature. Am I using the Textblock in a right way or am I missing something in the above code ? Please do let me know,
Hm, I can't really tell from the code above. I would expect some code that uses the existing iterator mechanism to walk through a page and find links and buttons, and so on. Maybe you could use findtext.cc as an example. Regards, Johannes PS: The keyboard navigation feature would be highly appreciated!