Example #1
0
    def init(self):
        tb = gtk.VBox()
        self.toolbar.pack_start(tb, expand=False)

        self.dir_label = gtk.Label()
        tb.pack_start(self.dir_label)

        ctrls = gtkextra.Toolbar(self.cb)
        tb.pack_start(ctrls.win)

        ctrls.add_button('up', self.cb_but, 'Go to the parent directory',
                         ['up'])
        ctrls.add_button('new', self.cb_but,
                         'Create a new file, and edit it in vim.', ['new'])
        ctrls.add_button('open', self.cb_but, 'Open the file in vim.',
                         ['open'])
        ctrls.add_button('delete', self.cb_but, 'Delete the file.', ['delete'])
        ctrls.add_separator()
        ctrls.add_button('terminal', self.cb_but,
                         'Open a shell in the current directory', ['terminal'])
        #self.view.connect('row-expanded', self.cb_expand)
        self.view.connect('test-expand-row', self.cb_expand)

        self.filemenu = gtkextra.ContextPopup(self.cb, 'file')
        self.dirmenu = gtkextra.ContextPopup(self.cb, 'dir')

        self.root = None
Example #2
0
    def populate_widgets(self):
        self.second_toolbar = gtkextra.Toolbar()
        self.add(self.second_toolbar.win, expand=False)

        self.second_toolbar.add_button('cut', self.cb_gazpacho,
                                       'Cut the selection', ['cut'])
        self.second_toolbar.add_button('copy', self.cb_gazpacho,
                                       'Copy the selection', ['copy'])
        self.second_toolbar.add_button('paste', self.cb_gazpacho,
                                       'Paste the selection', ['paste'])
        self.second_toolbar.add_button('delete', self.cb_gazpacho,
                                       'Paste the selection', ['delete'])
        self.second_toolbar.add_separator()
        self.undo_but = self.second_toolbar.add_button(
            'undo', self.cb_gazpacho, 'Undo the last operation', ['undo'])
        self.redo_but = self.second_toolbar.add_button(
            'redo', self.cb_gazpacho, 'Redo the last operation', ['redo'])

        self.holder = gtk.VBox()
        self.add(self.holder)
        self.button = gtk.Button(label='Launch Gazpacho\n\n'
                                 '(user interface designer)')
        self.holder.pack_start(self.button)
        self.button.connect('clicked', self.cb_alternative)

        self.add_button('save', self.cb_gazpacho, 'Save the current file',
                        ['save'])
        self.add_button('open', self.cb_gazpacho, 'Open a file', ['open'])
Example #3
0
    def do_init(self):
        self.fetcher = Fetcher(self)
        self.doc = gtkhtml2.Document()
        self.doc.connect('request-url', self.cb_request_url)
        self.doc.connect('link-clicked', self.cb_link_clicked)
        self.view = gtkhtml2.View()
        self.view.connect('on-url', self.ro)
        self.view.set_document(self.doc)
        self.view.set_size_request(400, 300)
        self.swin = gtk.ScrolledWindow()
        self.swin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.swin.add(self.view)

        self.win = gtk.VBox()

        hb = gtk.HBox()
        toolbar = gtkextra.Toolbar()
        hb.pack_start(toolbar.win, expand=False)

        toolbar.add_button('left', self.cb_back_clicked, 'Back')
        toolbar.add_button('close', self.cb_stop_clicked, 'Stop')

        self.location = gtk.Entry()
        hb.pack_start(self.location)

        self.location.connect('activate', self.cb_url_entered)

        self.win.pack_start(hb, expand=False)
        self.win.pack_start(self.swin)

        self.urlqueue = []
        self.urlqueueposition = 0
Example #4
0
    def __init__(self, notebook, icon, immortal=False):
        self.cb = cb
        # the parent notebook
        self.notebook = notebook
        # generate widgets
        gtk.VBox.__init__(self)
        # terminal widget
        # tab label
        self.label = Tablabel(self.cb, icon)
        # can we be killed?
        self.immortal = immortal
        # the PID of the child process
        self.pid = -1

        self.toolbar = gtkextra.Toolbar(self.cb)

        self.pack_start(self.toolbar.win, expand=False)

        self.back_but = self.toolbar.add_button('left', self.cb_back,
                                                'Go back')
        self.next_but = self.toolbar.add_button('right', self.cb_forw,
                                                'Go Forwards')
        self.toolbar.add_button('close', self.cb_stop, 'Stop loading')
        self.toolbar.add_button('refresh', self.cb_reload, 'Reload Page')

        self.urlentry = gtk.Entry()
        self.urlentry.connect('activate', self.cb_urlentered)
        self.toolbar.win.pack_start(self.urlentry)

        self.progresslabel = gtk.Label()
        self.toolbar.win.pack_start(self.progresslabel, expand=False)

        self.next_but.set_sensitive(False)
        self.back_but.set_sensitive(False)

        self.socket = gtk.Socket()
        self.pack_start(self.socket)
        self.socket.realize()
Example #5
0
 def __init__(self, cb, callbackfunc):
     self.cb = cb
     self.callbackfunc = callbackfunc
     self.toolbar = gtkextra.Toolbar(self.cb)
     self.add_default_buttons()
     self.add_custom_buttons()
Example #6
0
 def do_init(self, callbackfunc):
     self.callbackfunc = callbackfunc
     self.toolbar = gtkextra.Toolbar()
     self.add_default_buttons()
     self.add_custom_buttons()