After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 530145 - Missing method gtk.TreeView.get_tooltip_context
Missing method gtk.TreeView.get_tooltip_context
Status: RESOLVED FIXED
Product: pygtk
Classification: Bindings
Component: gtk
Git Master
Other Linux
: Normal normal
: pygtk-2.14
Assigned To: Gian Mario Tagliaretti
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-27 03:11 UTC by Björn Lindqvist
Modified: 2008-06-22 18:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tooltip context patch (1.65 KB, patch)
2008-05-03 15:29 UTC, Gian Mario Tagliaretti
none Details | Review
tooltip context patch rev. 1 (3.17 KB, patch)
2008-06-22 17:06 UTC, Gian Mario Tagliaretti
committed Details | Review

Description Björn Lindqvist 2008-04-27 03:11:54 UTC
GtkTreeView has a method gtk_tree_view_get_tooltip_context() it seem to be missing in PyGTK.
Comment 1 Gian Mario Tagliaretti 2008-05-03 15:29:40 UTC
Created attachment 110323 [details] [review]
tooltip context patch

This is a tricky one to wrap, if I understood correctly the enclosed patch should be (hopefully) ok.
Comment 2 Björn Lindqvist 2008-06-20 22:48:41 UTC
The patch seem to almost work, except for the typo on this line:

+                        kwlist, &x, &x, &py_keyboard_tip))

(two x:es). And the iterator returned doesn't seem to be correct. With the patch and with the typo fixed, the following tc still fails:

def test_get_tooltip_context_on_populated_model_kbd_tip():
    store = gtk.ListStore(int)
    for x in range(10):
        store.append([1])
    view = gtk.TreeView(store)
    column = gtk.TreeViewColumn("c1", gtk.CellRendererText(), text = 0)
    view.append_column(column)
    win = gtk.Window()
    win.add(view)
    win.show_all()
    model, path, iter = view.get_tooltip_context(0, 0, True)

    assert model == store
    assert path == (0,)
    assert model.get_value(iter, 0) == 1

The traceback is strange:

    assert model.get_value(iter, 0) == 1
  • File "/home/bjourne/cvsgnome/install/lib/python2.4/warnings.py", line 61 in warn
    warn_explicit(message, category, filename, lineno, module, registry)
  • File "/home/bjourne/cvsgnome/install/lib/python2.4/warnings.py", line 84 in warn_explicit
    if ((msg is None or msg.match(text)) and
TypeError: unknown type (null)

Comment 3 Gian Mario Tagliaretti 2008-06-22 17:06:25 UTC
Created attachment 113207 [details] [review]
tooltip context patch rev. 1

Updated, I've also modified the tooltip demo using the method.

Björn your testcase passes with the updated patch, can you try it out?
Comment 4 Gian Mario Tagliaretti 2008-06-22 18:29:12 UTC
Sending        ChangeLog
Sending        examples/pygtk-demo/demos/tooltip.py
Sending        gtk/gtktreeview.override
Transmitting file data ...
Committed revision 2996.