Tkinter and printf in C ...
sholden at holdenweb.com
Mon Jul 9 07:59:06 EDT 2001
That's why my first example was over-complicated. I was displaying email
messages parsed from a file after selection from a list item. All that code
was highly specific to my program, and shouldn't be expected to make much
sense to you. It's the insert() method of the Text and scrolledText objects
I ws trying to pint you at!
"Chyr-Pyng Su" <cpsu at larc.ee.nthu.edu.tw> wrote in message
news:3B4943F0.35F0FADA at larc.ee.nthu.edu.tw...
> > OK, I was running a little too fast. The "self" in the code I showed you
> > referred to the object whose class implementation I had extracted the
> > from, so you all you need to know is that is was the parent of the
> > Pmw.ScrolledText object in which I was rendering text.
> > Suppose that the error message returned by the wrapped C function has
> > stored in st. To create a Text widget in a separate top-level window and
> > display the message in it, you would do (something like: warning,
> > msgWindow = Toplevel(height=350, width=500)
> > msgWindow.columnconfigure(0, weight=1)
> > msgWindow.rowconfigure(0, weight=1)
> > t = Text(msgWindow)
> > grid(t, row=0, column=0, sticky=N+E+W+S)
> > t.insert(END, st)
> > I have here assumed that like most Tkinter programmers you have used
> > Tkinter import *", and that you are using (or are prepared to use) the
> > geometry management.
> > Does this make it any clearer?
> > regards
> > Steve
> > --
> > http://www.holdenweb.com/
> :> I know 'self', but the question is 'index' . The following code
> is what I really
> interesting. That is, how to catch the message that transfer from wrapped
> strmes =
> message = mimecntl.MIME_document(strmes)
> for hdr in ("from", "date", "subject", "to", "cc"):
> hdrline = message[hdr]
> t.insert(END, "%s: %s\n" %
> except KeyError:
> From my experiment, Using Pmw package to write my GUI, the dumped message
> will popup a error message dialog, but this won't happen when I implement
> in original Tkinter package. Could you explain the MsgSet..
> these functions..
> or tell me where to find related document that describe those mechanism,
> that I can study
> it. I can't find these stuff in Pmw or Tkinter document... :p
> Ä¬«ù¥ Su, Chyr-Pyng o888o V o888o
> VLSI Design, Testing and Fault Tolerance Lab. o8 ~__ __ 8o
> EE. National Tsing Hau Univ. Taiwan 88o ooo o88
> o 8^ ^8 o
> E-Mail: cpsu at larc.ee.nthu.edu.tw /- 88_____88 -\
> WWW: http://larc.ee.nthu.edu.tw/~cpsu _\ qioip /_
More information about the Python-list