RubyTalk@gmail.com
3/18/2006 8:49:00 PM
I was trying every combination of anything, and this works. dont know
what but it does.
I moved the elements of the frame up to the top instead of making a
new frame, and moved the render to the call that makes it visable.
Also i save the text to a temp file. I didnt want to do this, but it
works.
Still any ideas would be welcome.
$tbody_root=TkRoot.new
$tbody_frame_over = TkToplevel.new($root){
$gtkbodys=Tk::Iwidgets::Scrolledhtml.new(self){ }.pack "side"=>"top"
$gtkbodys.height=200
TkButton.new(self) {
text "ok"
command {
$tbody_frame_over.withdraw
}}.pack "side"=>"bottom"
}
$tbody_frame_over.withdraw
-------------cut-----
localtext="<html><body>"+$Account.msg(temp).dt_easy + " subject:
" + $Account.msg(temp).subject
localtext=localtext+ " Body: "
localtext=localtext+ test
$tbodytexts=(localtext+"</body></html>").to_s
# p $tbodytexts
x = (200)
y = (200)
#tt=
#p $tbodytexts
tf = Tempfile.new("afile")
tf.puts($tbodytexts)
# p tf.path
tf.close
tf.open
$gtkbodys.render($tbodytexts)
$tbody_frame_over.geometry("+#{x+1}+#{y+1}")
$tbody_frame_over.deiconify
$tbody_frame_over.raise
On 3/18/06, ruby talk <rubytalk@gmail.com> wrote:
> I want a frame to pop up with this in it. $tbodytext is my var of html
> code. I did check the var before and after the render call, and it is
> correct (i know i should not use globa vars but its my first TK
> program and need to access info every where. I can also post my full
> code (other then render it works, and u just need tk and the gmailer
> library.)
>
> So the question is, can it not render the string i pass it? If i set
> static text it displays that. i could save it to a file then read the
> file , but i dont really want to do that.
>
> Becker
>
>
> $tbody_root=TkRoot.new
> $tbody_frame_over = TkToplevel.new($root){}
> $tbody_frame_over.withdraw
>
> ---------cut out code---------
>
> #the $Account is a gmail count, this gets the email info
> localtext="<html><body>"+$Account.msg(temp).dt_easy + " subject:
> " + $Account.msg(temp).subject
> localtext=localtext+ " Body: "
> localtext=localtext+ test
> $tbodytexts=(localtext+"</body></html>").to_s
> p $tbodytexts
> x = (200)
> y = (200)
> $tbody_frame_over.geometry("+#{x+1}+#{y+1}")
> $tbody_frame_over.deiconify
> $tbody_frame_over.raise
>
> cut out code
>
>
> TkFrame.new($tbody_frame_over){
> tkbodys=Tk::Iwidgets::Scrolledhtml.new(self){ }.pack "side"=>"top"
> tkbodys.height=200
> tt=$tbodytexts
> tkbodys.render(tt)
> TkButton.new(self) {
> text "ok"
> command {
> $tbody_frame_over.withdraw
> }}.pack "side"=>"bottom"
> }.pack "side"=>"left"
>
>