Tkinter and printf in C ...

Steve Holden sholden at holdenweb.com
Fri Jul 6 14:00:36 CEST 2001


"Chyr-Pyng Su" <cpsu at larc.ee.nthu.edu.tw> wrote in message
news:3B455B5D.544A2EF5 at larc.ee.nthu.edu.tw...
>
> Recently I have wrote a program in C, and start to write the GUI for it.
>
> I want to capture the message dump by the C program and show them on a
> text window.
> Does anyone have some idea to do that???   redirect the stdout???
>
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
--
http://www.holdenweb.com/




--
http://www.holdenweb.com/








More information about the Python-list mailing list