Ethereal-dev: Re: [Ethereal-dev] small keyboard request

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Mon, 9 Jul 2001 16:04:31 -0700 (PDT)
> I have a working patch for this. It's something I hacked together
> during the last two weeks I was off from work.

Checked in.

> The good thing about the patch is that it works, the bad thing is that
> it accesses GtkCTree directly, not through the API. I did not have all
> the documentation available when I did the patch, but I think the API
> does not provide a method for accessing the selected row.

There isn't one, as far as I know.

However, the "tree-select-row" signal on a GtkCTree is emitted when a
row is selected, and the callback for that signal can keep track of
information about the currently selected row.

In fact, it does that in Ethereal; in "create_main_window()" we have:

  gtk_signal_connect(GTK_OBJECT(tree_view), "tree-select-row",
    GTK_SIGNAL_FUNC(tree_view_select_row_cb), NULL);

"tree_view_select_row_cb()" could keep track of the currently selected
row, and the callback for key-press-event could use that.

We do the same for additional packet windows; this means we'd have to
keep track of *multiple* selected rows in *different* CTree widgets if
we did that.  It may be easier to do this the way we are doing it now.