Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 def _init_widgets(self):
     self._top_frame = Tix.Frame(self)
     self._top_frame.pack(side=Tix.TOP, fill=Tix.BOTH, expand=True)
     self._chanlist_ = Tix.ScrolledListBox(self._top_frame)
     self._chanlist_.pack(side=Tix.LEFT, fill=Tix.Y)
     self._chanlist = self._chanlist_.listbox
     self._chanlist.configure(selectmode=Tix.BROWSE)
     # XXX: ScrolledListBox sucks in this respect.
     self._chanlist.configure(bg="white")
     self._channel_frames = { }
     f = Tix.Frame(self)
     f.pack(side=Tix.BOTTOM, fill=Tix.X)
     self._nicklabel = Tix.Label(f, text="(unnamed)")
     self._nicklabel.pack(side=Tix.LEFT)
     self._chatvar = Tix.StringVar()
     self._chatbox = Tix.Entry(f, textvariable=self._chatvar)
     self._chatbox.pack(side=Tix.LEFT, fill=Tix.X, expand=True)
     self._chatbox.focus()
     Tix.Button(f, text="Send", command=self._do_send).pack(side=Tix.RIGHT)
     _kui.set_colors(self, "window")
     _kui.set_colors(self._nicklabel, "window")
     _kui.set_colors(self._chatbox, "chatbox")
     _kui.set_colors(self._chanlist, "channel_list")