Re: gtk_tree_path_new_from_indices and gtk_tree_row_reference_new



Torsten Schoenfeld said:
On Thu, 21 Aug 2003 11:05:12 -0400 (EDT), muppet wrote:

also, since the C stuff will stop when it sees a -1, there's no point
in us passing the rest of the stuff after a -1, hence, 'we should stop
at -1 since that's what the C stuff will do anyway.'

Ah, I see. If you look at the patch you'll see that the wrapper actually
is no wrapper as it doesn't call gtk_tree_path_new_from_indices but
imitates what the C function does internally. The -1 problem persists,
though.

oh yeah... the C function is a varargs one, which we can't really call anyway
without non-portable stack-twiddling black magic.

well, the docs say to terminate the list with a -1, so we *will* have people
sticking a -1 in the list.  gtk_tree_path_append_index asserts that index>=0,
and will put a warning on stderr[*] to that effect.  should we trap that at
the wrapper level and print out a friendly message that says "you don't need a
sentinel"?  there's nothing else intelligent we can do with a negative value,
because we don't have a model and thus can't consider it to be so many from
the end...


[*] on a related note, i noticed last night while digging in Gtk-Perl-0.7009
that gtk-perl proxied all of the Gtk and Gdk log messages (stuff that would
come out from gtk_return_if_fail()) through a custom handler that would warn()
for nonfatal and croak() for fatal messages, and also looked to see if the
perl developer had provided and override for the default log handler.  this,
in theory, made it possible to trap fatal Gtk errors as perl exceptions.

should we do the same on gtk2-perl?  it would be easy enough to do...

-- 
muppet <scott at asofyet dot org>



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