def _quit(event=None): if _kc.confirm_quit and len(mainframe._notebook.pages()) > 1: r = _tkmb.askyesno("Warning", "There are networks still open. \ Are you sure you want to quit?") if not r: return _kp.call_plugins("on_kaechat_quit") root.destroy() root.quit()
def body(self, master): self.resizable(False, False) self._notebook = Tix.NoteBook(master) self._notebook.pack(side=Tix.TOP, fill=Tix.BOTH, expand=True) self._btnbox = Tix.Frame(master) self._btnbox.pack(side=Tix.BOTTOM, fill=Tix.X) Tix.Button(self._btnbox, text="Cancel", command=self.cancel).pack(side=Tix.RIGHT) Tix.Button(self._btnbox, text="OK", command=self.ok).pack(side=Tix.RIGHT) self.pages = [ ] for page in _pages: self.add_page(page) _kp.call_plugins("on_prefswindow_create", self)
def __init__(self, frame=None, pagename=None, network=None, netid=None): Tix.Frame.__init__(self, frame) self._frame = frame self._pagename = pagename self._network = network self._netid = netid self._cur_channel = None self._history = [ "" ] self._hist_index = 0 self._active = True self._init_widgets() self._init_bindings() self._thread = _kct.ClientThread(self) self._thread.start() _kp.call_plugins("on_networkframe_create", self)
def _init_widgets(self): f = Tix.Frame(self) f.pack(side=Tix.TOP, fill=Tix.BOTH, expand=True) ff = Tix.Frame(f) ff.pack(side=Tix.LEFT, fill=Tix.BOTH, expand=True) if self._channel[0] in kaeirc.CHANNEL_PREFIXES: self._topicvar = Tix.StringVar() self._topicbox = Tix.Entry(ff, textvariable=self._topicvar) self._topicbox.pack(side=Tix.TOP, fill=Tix.X) else: self._topicbox = None self._textbox_ = Tix.ScrolledText(ff) self._textbox_.pack(side=Tix.BOTTOM, fill=Tix.BOTH, expand=True) self._textbox = self._textbox_.text self._textbox.configure(state=Tix.DISABLED) if self._channel[0] in kaeirc.CHANNEL_PREFIXES: ff = Tix.Frame(f) ff.pack(side=Tix.RIGHT, fill=Tix.BOTH) self._userlistlabel = Tix.Label(ff) self._userlistlabel.pack(side=Tix.TOP, fill=Tix.X) self._userlist_ = Tix.ScrolledListBox(ff) self._userlist_.pack(side=Tix.BOTTOM, fill=Tix.BOTH, expand=True) self._userlist = self._userlist_.listbox self._userlist.configure(selectmode=Tix.BROWSE, bg="white") colors = self._colors or self.default_colors for i in range(len(colors)): c = colors[i] self._textbox.tag_configure("color_%d" % i, foreground=c) self._textbox.tag_configure(_kui.WEB_LINK_TAG, foreground="#0000FF") m = Tix.Menu(self._userlist, tearoff=False) m.add_command(label="Who is this?", command=self._whois_ul) m.add_command(label="Start conversation", command=self._start_query_ul) self._userlist.menu = m _kui.set_colors(self._userlistlabel, "window") _kui.set_colors(self._userlist, "user_list") else: self._userlist = None _kui.set_colors(self, "window") _kui.set_colors(self._textbox, "textbox") _kp.call_plugins("on_channelframe_create", self)