[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Tk dialogs

R. Mark Volkmann

12/9/2004 2:04:00 PM

How can I add widgets like TkEntry to a TkDialog? I've written a class that
inherits from TkDialog, but I can't figure out how to add widgets in the
initialize method. Maybe that's not possible and I should use a TkFrame
instead to implement a custom dialog box.

--
R. Mark Volkmann
Partner, Object Computing, Inc.


9 Answers

Hidetoshi NAGAI

12/10/2004 2:34:00 AM

0

R. Mark Volkmann

12/12/2004 3:39:00 AM

0

How can I exit a Ruby application that uses Tk without getting the following
message?

"This application has requested the Runtime to teminate it in an unusual
way."

Using Kernel#exit gives me this message.




Bill Atkins

12/12/2004 8:53:00 PM

0

Tk.exit ?

On Sun, 12 Dec 2004 12:38:38 +0900, R. Mark Volkmann <mark@ociweb.com> wrote:
> How can I exit a Ruby application that uses Tk without getting the following
> message?
>
> "This application has requested the Runtime to teminate it in an unusual
> way."
>
> Using Kernel#exit gives me this message.
>
>

--
$stdout.sync = true
"Just another Ruby hacker.".each_byte do |b|
('a'..'z').step do|c|print c+"\b";sleep 0.007 end;print b.chr
end; print "\n"


R. Mark Volkmann

12/13/2004 2:23:00 AM

0

----- Original Message -----
From: "Bill Atkins" <batkins57@gmail.com>
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Sent: Sunday, December 12, 2004 2:52 PM
Subject: Re: clean Tk exit


> Tk.exit ?

Nope. I still get the same message when the application exits.
Any other ideas?

> On Sun, 12 Dec 2004 12:38:38 +0900, R. Mark Volkmann <mark@ociweb.com>
> wrote:
>> How can I exit a Ruby application that uses Tk without getting the
>> following
>> message?
>>
>> "This application has requested the Runtime to teminate it in an unusual
>> way."
>>
>> Using Kernel#exit gives me this message.




Bill Atkins

12/13/2004 4:17:00 PM

0

Are you using any other libraries aside from Tk?


On Mon, 13 Dec 2004 11:23:16 +0900, R. Mark Volkmann <mark@ociweb.com> wrote:
> ----- Original Message -----
> From: "Bill Atkins" <batkins57@gmail.com>
> To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
> Sent: Sunday, December 12, 2004 2:52 PM
> Subject: Re: clean Tk exit
>
> > Tk.exit ?
>
> Nope. I still get the same message when the application exits.
> Any other ideas?
>
>
>
> > On Sun, 12 Dec 2004 12:38:38 +0900, R. Mark Volkmann <mark@ociweb.com>
> > wrote:
> >> How can I exit a Ruby application that uses Tk without getting the
> >> following
> >> message?
> >>
> >> "This application has requested the Runtime to teminate it in an unusual
> >> way."
> >>
> >> Using Kernel#exit gives me this message.
>
>


--
$stdout.sync = true
"Just another Ruby hacker.".each_byte do |b|
('a'..'z').step do|c|print c+"\b";sleep 0.007 end;print b.chr
end; print "\n"


R. Mark Volkmann

12/13/2004 4:41:00 PM

0

Quoting Bill Atkins <batkins57@gmail.com>:

> Are you using any other libraries aside from Tk?

No, just Tk.

The following simple snippet of code demonstrates the problem. I see the
problem under Windows XP, but not under Windows 2000. On both platforms I'm
using ruby 1.8.2 (2004-11-06) from the Windows one-click installer.

require 'tk'
root = TkRoot.new
button = TkButton.new(root)
button.command lambda {Tk.exit}
button.text 'Exit'
button.pack
Tk.mainloop

> On Mon, 13 Dec 2004 11:23:16 +0900, R. Mark Volkmann <mark@ociweb.com> wrote:
> > ----- Original Message -----
> > From: "Bill Atkins" <batkins57@gmail.com>
> > To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
> > Sent: Sunday, December 12, 2004 2:52 PM
> > Subject: Re: clean Tk exit
> >
> > > Tk.exit ?
> >
> > Nope. I still get the same message when the application exits.
> > Any other ideas?
> >
> >
> >
> > > On Sun, 12 Dec 2004 12:38:38 +0900, R. Mark Volkmann <mark@ociweb.com>
> > > wrote:
> > >> How can I exit a Ruby application that uses Tk without getting the
> > >> following
> > >> message?
> > >>
> > >> "This application has requested the Runtime to teminate it in an unusual
> > >> way."
> > >>
> > >> Using Kernel#exit gives me this message.
> >
> >
>
>
> --
> $stdout.sync = true
> "Just another Ruby hacker.".each_byte do |b|
> ('a'..'z').step do|c|print c+"\b";sleep 0.007 end;print b.chr
> end; print "\n"
>
>


--
R. Mark Volkmann
Partner, Object Computing, Inc.


Hidetoshi NAGAI

12/14/2004 1:01:00 AM

0

Curt Hibbs

12/14/2004 2:17:00 AM

0

Hidetoshi NAGAI wrote:
>
> Hi,
>
> From: "R. Mark Volkmann" <mark@ociweb.com>
> Subject: Re: clean Tk exit
> Date: Tue, 14 Dec 2004 01:41:20 +0900
> Message-ID: <1102955875.41bdc563a99e7@mail.ociweb.com>
> > The following simple snippet of code demonstrates the problem.
> I see the
> > problem under Windows XP, but not under Windows 2000. On both
> platforms I'm
> > using ruby 1.8.2 (2004-11-06) from the Windows one-click installer.
>
> I don't know that your tcltklib binary on your ruby is a patched
> version or not.
> Does anyone know that the current one-click installer (182-RC10)
> is applied the patch of [ruby-talk: 119637] ?
> If use the patched version, that is a new problem.
> I want to know the same problem occurs or not on Tk8.4 or 8.5
> (see [ruby-talk: 120774]).

No patches have been applied in the one-click installer.

Curt


Mike Jones

12/14/2004 11:40:00 AM

0

R. Mark Volkmann wrote:
> Quoting Bill Atkins <batkins57@gmail.com>:
>
>
>>Are you using any other libraries aside from Tk?
>
>
> No, just Tk.
>
> The following simple snippet of code demonstrates the problem. I see the
> problem under Windows XP, but not under Windows 2000. On both platforms I'm
> using ruby 1.8.2 (2004-11-06) from the Windows one-click installer.
>
> require 'tk'
> root = TkRoot.new
> button = TkButton.new(root)
> button.command lambda {Tk.exit}
> button.text 'Exit'
> button.pack
> Tk.mainloop
>

I just tried the following with the latest one click installer for Ruby.
I am running Windows XP SP2 and this code run from irb worked fine.