Beispiel #1
0
    def __init__(self, parent):
        BaseWindow.__init__(self, "editor", parent, "core.glade")

        # bind widgets
        self.statusbar = self.widgets.statusbar
        self.set_statusbar_msg("initial_message", "Newsletter Mail System gestartet")
        self.window.maximize()

        theme = ctx.theme_loader.current
        nodes = theme.token_tree.find_all(jnodes.Block)

        wrapper = self.widgets.text_wrapper
        self.text_views = []
        for node in nodes:
            expander = gtk.Expander(node.name)
            vbox = gtk.VBox()
            view = gtk.TextView()
            view.set_buffer(TextBuffer())
            buffer = view.get_buffer()
            for signal in ("copy", "paste", "cut"):
                view.connect(signal + "-clipboard", getattr(self, "on_%s" % signal))
            view.set_property("height-request", 250)
            view.set_property("can-focus", True)
            self.text_views.append(view)
            vbox.pack_start(scrolled(view, height=200))
            expander.add(vbox)
            wrapper.pack_start(expander, False, False, 5)
            sep = gtk.HSeparator()
            sep.set_property("height-request", 5)
            wrapper.pack_start(sep, False, False, 10)
        wrapper.show_all()

        for view in self.text_views:
            buf = view.get_buffer()
            # TEST
            buf.set_text(
                "bold, italic, normal, \n\n\n\n And now some underlined text..."
                "\n\nBut delted text is also possible...."
            )
            ao = buf.get_iter_at_offset
            buf.toggle_wrap_text((ao(0), ao(4)), "bold")
            buf.toggle_wrap_text((ao(6), ao(12)), "italic")
            buf.toggle_wrap_text((ao(27), ao(55)), "underline")
            buf.toggle_wrap_text((ao(60), ao(92)), "strikethrough")
            renderer = PangoHTMLRenderer(buf)
            print renderer.get_tags()
            # print '---------------------------------------------------------\n\n'
            # print renderer.get_text()
            # print '---------------------------------------------------------\n\n'
            # print PangoPlainRenderer(buf).get_text()
        ctx.logger.debug("initalized editor window")
Beispiel #2
0
    def __init__(self, parent):
        BaseWindow.__init__(self, 'editor', parent, 'core.glade')

        # bind widgets
        self.statusbar = self.widgets.statusbar
        self.set_statusbar_msg('initial_message', 'Newsletter Mail System gestartet')
        self.window.maximize()

        theme = ctx.theme_loader.current
        nodes = theme.token_tree.find_all(jnodes.Block)

        wrapper = self.widgets.text_wrapper
        self.text_views = []
        for node in nodes:
            expander = gtk.Expander(node.name)
            vbox = gtk.VBox()
            view = gtk.TextView()
            view.set_buffer(TextBuffer())
            buffer = view.get_buffer()
            for signal in ('copy', 'paste', 'cut'):
                view.connect(signal+'-clipboard',
                             getattr(self, 'on_%s' % signal))
            view.set_property('height-request', 250)
            view.set_property('can-focus', True)
            self.text_views.append(view)
            vbox.pack_start(scrolled(view, height=200))
            expander.add(vbox)
            wrapper.pack_start(expander, False, False, 5)
            sep = gtk.HSeparator()
            sep.set_property('height-request', 5)
            wrapper.pack_start(sep, False, False, 10)
        wrapper.show_all()

        for view in self.text_views:
            buf = view.get_buffer()
            #TEST
            buf.set_text('bold, italic, normal, \n\n\n\n And now some underlined text...'
                        '\n\nBut delted text is also possible....')
            ao = buf.get_iter_at_offset
            buf.toggle_wrap_text((ao(0), ao(4)), 'bold')
            buf.toggle_wrap_text((ao(6), ao(12)), 'italic')
            buf.toggle_wrap_text((ao(27), ao(55)), 'underline')
            buf.toggle_wrap_text((ao(60), ao(92)), 'strikethrough')
            renderer = PangoHTMLRenderer(buf)
            print renderer.get_tags()
            #print '---------------------------------------------------------\n\n'
            #print renderer.get_text()
            #print '---------------------------------------------------------\n\n'
            #print PangoPlainRenderer(buf).get_text()
        ctx.logger.debug('initalized editor window')
Beispiel #3
0
 def __init__(self):
     BaseWindow.__init__(self, "main_window", filename="core.glade")
Beispiel #4
0
 def __init__(self):
     BaseWindow.__init__(self, 'main_window', filename='core.glade')