catching exceptions



I must be missing something:

I am trying to get an iter on a line.

Sometimes the offset is too big so the below function throws
an exception:

$end_iter= $buffer->get_iter_at_line_offset($line, $end);

Gtk-ERROR **: Char offset 24 is off the end of the line at ....

The problem is that even if I put the expression in eval it does not
catch it.

Can I catch this exception somehow?



As a workaround, can I get the length of a row from the Text::Buffer?

Gabor



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