Forum: Ruby Tk::Iwidgets::Scrolledhtml render problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
ruby talk (Guest)
on 2006-05-03 21:11
(Received via mailing list)
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"
ruby talk (Guest)
on 2006-08-03 15:28
(Received via mailing list)
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
Hidetoshi NAGAI (Guest)
on 2006-08-03 15:30
(Received via mailing list)
From: "ruby talk" <removed_email_address@domain.invalid>
Subject: Re: Tk::Iwidgets::Scrolledhtml render problem
Date: Sun, 19 Mar 2006 05:49:29 +0900
Message-ID: <removed_email_address@domain.invalid>
> 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.

I couldn't re-generate your problem.
When did you call "Tk.mainloop"?
"Tk.update" is sometimes helpful to fix some cases of drawing troubles.
This topic is locked and can not be replied to.