Tkinter and printf in C ...

Chyr-Pyng Su cpsu at larc.ee.nthu.edu.tw
Sun Jul 8 03:10:38 EDT 2001


Steve Holden wrote:

>
> Sorry, should have read the subject line. Here's a snippet of code that
> write to a PMW scrolled text window, you should be able to do the same in a
> Tkinter text window.
>
>         t = Pmw.ScrolledText(self.msgWindow)
>         grid(t, row=0, column=0, sticky=N+E+W+S)
>         strmes =
> self.index.Message(self.MsgSet[int(self.msgList.curselection()[0])][0])
>         message = mimecntl.MIME_document(strmes)
>         for hdr in ("from", "date", "subject", "to", "cc"):
>             try:
>                 hdrline = message[hdr]
>                 t.insert(END, "%s:     %s\n" %
> (string.capitalize(hdr),hdrline))
>             except KeyError:
>                 pass
>
> It's the insert() method you are looking for, I suspect.
>
> regards
>  Steve

Thanks in advance to help me writing the GUI program.. Actually I intended to
contruct a
buttom so that when I press it, it will trigger a wrapped function originally
written in C.
And capture those dumped message, show them in ScrolledText() widget..

Sorry, I can't figure out what the self.index is... besides, where should I
place these codes..
in the callback function or in top level... :O





More information about the Python-list mailing list