[Tutor] (no subject)

wheelege wheelege@tsn.cc
Sun, 21 Jan 2001 16:58:20 +1100


  Alright, comments through.

----- Original Message ------
From: Matthias Hager <martok@mattsmail.com>
To: <tutor@python.org>
Sent: Sunday, January 21, 2001 12:56 PM
Subject: [Tutor] (no subject)


> I know you guys are about to rip your hair out over me, I'm annoying I
know! But I have some questions here on how to do some special stuff in
Python. (And is it possible to use a GUI with Perl?)

  Yes, you can use Tcl with Perl.

>
> 1. How do I access the clipboard, so I can make cut and paste options?

  Don't know, try the tutorial or searching the docs.

> 2. What all does ScrollingText support?

  I don't know if this is the answer you wanted, but the ScrollBar (or
something) widget can be slapped on most things if neccessary.

> I've found background, fg, font. What else is there?

  Look in the docs for those widgets in question.

> How can I change the size of the text, and how can I add the ability to
have the user change the text color and everything?

  Again, docs are the key.

> How can I change how it rounds off its text on the right? It justs takes
whatever you type to the next line, cutting words in two.

  Clever manipulating of the string module, or you could always set the text
box up to do it - I think I saw a wordwrap option somewhere.  Just punch in
a carriage return if they are still typing a word (ie no spacebar character
been pushed yet)

> How can I change the blinking | thing's color?

  Don't know/look in documentation...

> And finally, how can I make it say stuff according to what they type? Like
in idle, if you start typing askopenfilename() It will tell you what to type
in? How do I do that?

  Use a for loop, stick an if in there and compare it to a dictionary (at a
guess..probably a much easier way)

>
> 3. What are, and how do I use classes? A program I saw, uses them, but
what are they?

  Classes are really cool things.  Read the tutorial - it explains it way
better than I could.

> 4. How do I open another window, that has more stuff in it, like buttons
and stuff?

  Create a new toplevel widget, shove stuff in it.  Or you could use a
mega-widget.  Again, look in the documentation for the toplevel widgets, pmw
etc.

> 5. How can I change what it says when they hover over an icon to my
program?

  Say time how long a pointer has been over a widget - you can use events
such as mouseenter, mouseleave (I think).

>
> 6. How do I check if they have made any changes to a file, and do
something according to whether they have or not?
>

  I haven't done much with files...but at a guess, just compare the two
using..

if file == oldfile:
  code

> Again, I'm sorry to bother you all.
> But thanks, A LOT.
>

  Hope I helped - I'm totally new too.  Seems you have alot of reading ahead
of you :)

  Glen.

> Matthias
>
>
>
>
>
> --
> Programming isn't cool, it's awesome.
>
> %%%################?????????###################^^^
>
>           martok@mattsmail.com
>       http://mymymatthias.tripod.com/
>
> %%%################????????####################^^^
>
>
> --
>
>
>
> Like my email address? Get your own for FREE at http://firstname.com
> Get you@JohnsMail.com or you@AlexsMail.com or pick from 500 more!
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor