def __init__(self, app, parent, draw_top=True): self.app = app wal.HTabPanel.__init__(self, parent, draw_top=draw_top, painter_index=config.tab_style) self.ctx_menu = ContextMenu(app, self, ITEMS) self.set_drop_target(wal.FileDropHandler(self, self.drop_file)) events.connect(events.CONFIG_MODIFIED, self.check_config)
def __init__(self, mw): self.app = mw.app self.bmp = get_icon(icons.CAIRO_BANNER, size=wal.DEF_SIZE) wal.StubPanel.__init__(self, mw) bg = wal.DARK_GRAY self.set_bg(bg) self.set_drop_target(wal.FileDropHandler(self, self.drop_file)) items = ((wal.ID_NEW, icons.PD_STUB_NEW), (wal.ID_OPEN, icons.PD_STUB_OPEN), (pdids.ID_VIEW_LOG, icons.PD_STUB_RECENT)) for pid, icon in items: action = self.app.actions[pid] tooltip = _('Open Recent') if pid == pdids.ID_VIEW_LOG \ else action.get_descr_text() icon = get_icon(icon, size=wal.DEF_SIZE) self.buttons.append(wal.StubBtn(self, bg, icon, action, tooltip)) self.buttons[-1].set_active(self.app.history.is_history()) events.connect(events.HISTORY_CHANGED, self.check_history) events.connect(events.CONFIG_MODIFIED, self.update)
def __init__(self, app, parent): self.app = app wal.MainCanvas.__init__(self, parent, rendering_delay=RENDERING_DELAY) self.ctx_menu = CanvasCtxMenu(self.app, self) self.kbproc = KbdProcessor(self.app) self.set_drop_target(wal.FileDropHandler(self, self.drop_file))