Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/test_abi_content.py
blob: 1c2e4b5e3582c048243526867827b3cb579b64c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from gi.repository import Gtk
from gi.repository import Abi


class TestAbi(Gtk.Window):

    def __init__(self):
        super(TestAbi, self).__init__()
        self.set_size_request(400, 400)
        self.connect("destroy", Gtk.main_quit)
        vbox = Gtk.VBox()
        self.abi = Abi.Widget()
        vbox.add(self.abi)
        button1 = Gtk.Button('Get selection')
        button1.connect('clicked', self.__get_selection_cb)
        vbox.add(button1)
        button2 = Gtk.Button('Get content')
        button2.connect('clicked', self.__get_content_cb)
        vbox.add(button2)

        self.add(vbox)
        self.show_all()

    def __get_selection_cb(self, button):
        print self.abi.get_selection('text/plain')

    def __get_content_cb(self, button):
        print self.abi.get_content('text/plain', None)

TestAbi()
Gtk.main()