On Wed, Dec 04, 2002 at 04:06:20AM -0800, David M. Cook wrote:
> Suppose you connect to a button-press-event on a TreeView.  You might like
> to know what numeric column was clicked so you can pass this to, say,
> store.set_value.  The callback has a TreeView and the event as parameters.
> You can get the widget coordinates as event.x and event.y, and
> TreeView.get_path_at_pos returns the path, a TreeViewColumn, and the (x,y)
> postion relative to the cell.  But what column was clicked? That's why I
> attach a numeric value to the TreeViewColumn at creation time with set_data.

Just as a quick question: would select-row not work in your case? And
what about get_selection_info() - is there a call like that for the
Treeview? For the CList it returns a tuple with the row and column
for the event passed in.

> I suppose you could also do something like view.get_columns.index(viewcol),
> but I have no idea if TreeView.get_columns is guarenteed to return the
> columns in their visible order.

Good point.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to