Hi

I have a simple GTK notebook example (see notebook.py attachment) that
contains a button one can use to change the text on the label of a
notebook tab.

My problem: I can't make LDTP pick up the changed tab labels

Example:
- run 'python notebook.py' in one console
- run python in interactive mode in another console
>>> import ldtp
>>> [i for i in ldtp.getobjectlist('Notebook Label Example') if 
>>> i.startswith('ptab')]
['ptabPage5', 'ptabPage1', 'ptabPage4', 'ptabPage2', 'ptabPage3']

If I now change a tab label e.g. 'Page 1' (by pressing the button
'Change Tab Label') ldtp.getobjectlist() still keeps returning the
same tabs. In fact

>>> ldtp.getobjectproperty('Notebook Label Example', u'ptabPage1', 'label')
'Page 1'

I even tried to run LDTPD directly using
>>> import ldtpd.core
>>> ldtp = ldtpd.core.Ldtpd()

Same result - it ignores any changes to tab labels.

If I restart the python/ldtp process it will pick up the changed tab labels.

I tried creating a new Ldtpd instance:
>>> ldtp = ldtpd.core.Ldtpd()
>>> [i for i in ldtp.getobjectlist('Notebook Label Example') if 
>>> i.startswith('ptab')]
['ptabPage5', 'ptabPage1', 'ptabPage4', 'ptabPage2', 'ptabPage3']

but this doesn't seem to be enough to pick up the changed tab.

Now the odd bit: I have fired up Orca Screen Reader - it doesn't pick
up the changed tab labels either which makes my think this is not a
problem with LDTP but the underlying at-spi layer and the Gnome
Notebook widget not being properly accessibility enabled. I get the
same result in Debian Jessie.

Is there something I can do from an app developer perspective to
publish the tab label change such that at-spi clients can pick it up?

Any suggestion for a more suitable mailing list to report the issue?

Thanks
Christian
#!/usr/bin/env python

import gtk

class NotebookLabelTest:

    tab_labels = {}

    def delete(self, widget, event=None):
        gtk.main_quit()
        return False

    def change_label(self, button, notebook):
        page = notebook.get_nth_page(notebook.get_current_page())
        label = self.tab_labels[page]
        label.set_text(label.get_text() + 'a')

    def __init__(self):
        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        window.set_title('Notebook Label Example')
        window.connect("delete_event", self.delete)
        window.set_border_width(10)

        box = gtk.VBox(True, True)
        window.add(box)

        notebook = gtk.Notebook()
        notebook.set_tab_pos(gtk.POS_TOP)
        box.pack_start(notebook, True, True, True)
        notebook.show()
        self.show_tabs = True
        self.show_border = True

        for i in range(5):
            frame = gtk.Frame()
            frame.set_size_request(100, 30)
            frame.show()

            label = gtk.Label("Page %d" % (i+1))
            self.tab_labels[frame]= label
            notebook.append_page(frame, label)

        button = gtk.Button("Change Tab Label")
        button.connect("clicked", self.change_label, notebook)
        box.pack_start(button, False, True, False)
        button.show()

        box.show()
        window.show()

if __name__ == "__main__":
    NotebookLabelTest()
    gtk.main()
_______________________________________________
LDTP-dev mailing list
LDTP-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/ldtp-dev

Reply via email to