Exemplo n.º 1
0
    def signal_clicked_cb(self, gl, item):
        pp = Popup(self._parent)
        pp.part_text_set('title,text', 'Signal content')

        en = Entry(self, text=prettify_if_needed(item.data['args']))
        en.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
        en.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
        en.size_hint_min = 800, 800  # TODO: this should be respected :/
        en.editable = False
        en.scrollable = True
        pp.content = en

        bt = Button(pp, text="Close")
        bt.callback_clicked_add(lambda b: pp.delete())
        pp.part_content_set('button2', bt)

        def prettify_clicked_cb(chk):
            options.pretty_output = chk.state
            en.text = prettify_if_needed(item.data['args'])

        ck = Check(pp, text="Prettify")
        ck.state = options.pretty_output
        ck.callback_changed_add(prettify_clicked_cb)
        pp.part_content_set('button1', ck)

        pp.show()