Subversion Repositories basico

Rev

Rev 124 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 124 Rev 125
Line 33... Line 33...
33
        scrolledwindow = Gtk.ScrolledWindow()
33
        scrolledwindow = Gtk.ScrolledWindow()
34
        scrolledwindow.set_hexpand(True)
34
        scrolledwindow.set_hexpand(True)
35
        scrolledwindow.set_vexpand(True)
35
        scrolledwindow.set_vexpand(True)
36
36
37
        textview = Gtk.TextView()
37
        textview = Gtk.TextView()
38
        textbuffer = textview.get_buffer()
-
 
39
        textbuffer.set_text("This is some text inside of a Gtk.TextView. "
-
 
-
 
38
        self.textbuffer = textview.get_buffer()
-
 
39
        self.textbuffer.set_text("This is some text inside of a Gtk.TextView. "
40
            + "Select text and click one of the buttons 'bold', 'italic', "
40
            + "Select text and click one of the buttons 'bold', 'italic', "
41
            + "or 'underline' to modify the text accordingly.")
41
            + "or 'underline' to modify the text accordingly.")
42
        scrolledwindow.add(textview)
42
        scrolledwindow.add(textview)
43
43
44
        box = self.get_content_area()
44
        box = self.get_content_area()
45
        box.add(scrolledwindow)
45
        box.add(scrolledwindow)
46
        self.show_all()
46
        self.show_all()
-
 
47
-
 
48
    def get_buffer(self):
-
 
49
        istart, iend = self.textbuffer.get_bounds()
-
 
50
        return self.textbuffer.get_text(istart, iend, False)
-
 
51
47
52
48
53
49
class Workplace(Service):
54
class Workplace(Service):
50
    def initialize(self):
55
    def initialize(self):
51
        '''
56
        '''
Line 62... Line 67...
62
        dialog = DlgImportFromLaunchpad(parent_window)
67
        dialog = DlgImportFromLaunchpad(parent_window)
63
        response = dialog.run()
68
        response = dialog.run()
64
69
65
        if response == Gtk.ResponseType.OK:
70
        if response == Gtk.ResponseType.OK:
66
            self.log.debug("The OK button was clicked")
71
            self.log.debug("The OK button was clicked")
-
 
72
            lines = dialog.get_buffer()
-
 
73
            self.cb.import_notes_from_sapnet(lines)
67
        elif response == Gtk.ResponseType.CANCEL:
74
        elif response == Gtk.ResponseType.CANCEL:
68
            self.log.debug("The Cancel button was clicked")
75
            self.log.debug("The Cancel button was clicked")
69
76
70
        dialog.destroy()
77
        dialog.destroy()
71
78