In answer to the first question, you can set the size of any widget with
the set_usize method. Note that for most widgets, the auto-sizing does a
good job. Also, you can specify a -1 for width or height, which means
leave the same. So to set the width of an GtkEntry to 200 without
adjusting the height, use
entry.set_usize(200, -1)
For the second question, if you don't want GTK to hang while waiting for
input from a pipe, use the input_add function, so that a callback will be
called whenever there is pending input. If you are writing a gnome app,
the alternative is to use the GnomeLess widget, which handles all this
input stuff for you.
In answer to stuffed up displaying of text, is the GtkText widget packed
in its parent properly and realized? If not, this may be the problem.
Alternatively, you could use the GtkEditable base class methods to insert
the text, which doesn't require the text box to be showing.
James Henstridge.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
On Sat, 28 Nov 1998, Martin Preishuber wrote:
> Hi there,
>
> I have 2 problems with using pygtk:
>
> - This one should be pretty easy ... Can i define the size of entry
> fields
> somehow ? I mean without messing around with boxes ...
>
> - Second I want to insert the output of some program into a GtkText
> field.
> I've done this this way:
>
> pipe = popen(command, "r")
>
> line = "full"
> while (line != ""):
> line = pipe.readline()
> if (line != ""):
> text.insert_defaults(line)
> mainiteration()
> pipe.close()
>
> Now there are a couple of problems: first the windows hangs as long as
> no output
> comes from the pipe. second some programs overwrite the output of a
> line (e.g
> those %-counter ... xx% where xx counts up) and this appears really
> messy in
> the text box ...
>
> I'm thankfull for every idea you have ... thanks :)
>
> Martin
>
> --
> Martin Preishuber - Student, ECLiPt Member, SysAdmin
> http://eclipt.uni-klu.ac.at,
> mailto:[EMAIL PROTECTED]
>
> Yow! Now we can become alcoholics!
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
>
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]