[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Ruby/TK packForget method

Alex DeCaria

3/5/2007 3:25:00 PM

Is there a Ruby/TK equivalent to the Perl/TK packForget or gridForget
methods, which will remove a widget from display, but doesn't destroy
the widget?

--
Posted via http://www.ruby-....

16 Answers

Morton Goldberg

3/6/2007 4:10:00 AM

0

On Mar 5, 2007, at 10:24 AM, Alex DeCaria wrote:

> Is there a Ruby/TK equivalent to the Perl/TK packForget or gridForget
> methods, which will remove a widget from display, but doesn't destroy
> the widget?

The following example shows how 'TkGrid.forget' can cause some
buttons to disappear.

<code>
# Clicking on the "four" button causes the "four" and "five" buttons to
# disappear.

require 'tk'

DEBUG = []

begin
root = TkRoot.new {title 'Tk Button Grid'}

lbls = ["one", "two", "three", "four", "five"]
btns = lbls.collect do |lbl|
TkButton.new(root, "text"=> lbl, "command"=>lambda { Tk.bell })
end
btns[0, 3].each_with_index do |b, i|
b.grid("row"=>0, "column"=>2*i, "columnspan"=>2)
end
btns[3, 2].each_with_index do |b, i|
b.grid("row"=>1, "column"=>3*i, "columnspan"=>3, "sticky"=>"ew")
end
btns[3].command = lambda { TkGrid.forget(*btns[3, 2]) } # <= *******

quit_btn = TkButton.new(root) {
text "Exit"
command { root.destroy }
}
quit_btn.grid("row"=>2, "column"=>2, "columnspan"=>2,
"sticky"=>"ew")

# Set window geometry.
min_w, min_h = 200, 95
root.minsize(min_w, min_h)
# Initial placement is top-center of screen.
root_x = (root.winfo_screenwidth - min_w) / 2
root.geometry("#{min_w}x#{min_h}+#{root_x}+50")

# Set resize permissions.
root.resizable(false, false)

# Make Cmnd+Q work as expected on OS X.
root.bind('Command-q') { Tk.root.destroy }

Tk.mainloop
ensure
puts DEBUG unless DEBUG.empty?
end
</code>

I imagine 'TkPack.forget' will work for packed widgets, but I have
not actually tried it.

Regards, Morton



I Approve This Nym

7/30/2007 3:24:00 AM

0


"Go Mavs" <Mav@ericks.com> wrote in message
news:cGcri.4941$FO1.1917@trnddc05...
>
> "Nebuchadnezzar II" <Nebuchadnezzar@microsoft.com> wrote in message
> news:tCcri.1102$vW.852@trnddc08...
>> I love it when Reichtards like you pass themselves off as experts on
>> economy and political history. You always fail miserably, but it's quite
>> entertaining to watch.
>
> More of the same from this rotted fag ass. All you do Neb is give pointles
> one liner insults and can never debate the quotes. Shows how weak your
> argument is. Now get back in bitch... you're not the driver of this car.

You pal is:
http://photos1.blogger.com/x/blogger/2180/585/320/47252/ElvisBin...


Nebuchadnezzar II

7/30/2007 3:39:00 AM

0

"Go Mavs" <Mav@ericks.com> wrote in message
news:cGcri.4941$FO1.1917@trnddc05...
>
> "Nebuchadnezzar II" <Nebuchadnezzar@microsoft.com> wrote in message
> news:tCcri.1102$vW.852@trnddc08...
>> I love it when Reichtards like you pass themselves off as experts on
>> economy and political history. You always fail miserably, but it's
>> quite entertaining to watch.
>
> More of the same from this rotted fag ass. All you do Neb is give
> pointles one liner insults and can never debate the quotes. Shows how
> weak your argument is. Now get back in bitch... you're not the driver
> of this car.

Freudian Projection.

You toss "one liner insults" like rotted fag ass, and "bitch", but you
do not address one single element of the OP's assertions or my refuting
said assertions.

Do as I say..., eh, ballboy?

You're delusional if you really think I care about your asinine insults
without any substance, towel boy.

You're a subliterate loser who has never amounted to anything and you
never will. You live off your family and wife's generosity (which won't
last) and it pains you that I point that out at every opportunity. If
you can't deal with being called a loser, stop being a loser, towel boy.
The choice has always been yours.

--
"Their are plenty of philanthropist you can buy from dipshit."
--Go Mavs, 7-27-2007


Go Mavs

7/30/2007 3:56:00 AM

0

you're my lap dog.. I ma you're every thought when you sign online...

here boy... here boy!


Nebuchadnezzar II

7/30/2007 4:02:00 AM

0

"Go Mavs" <Mav@ericks.com> wrote in message
news:Fjdri.1495$2c6.427@trnddc01...
> you're my lap dog.. I ma you're every thought when you sign online...
>
> here boy... here boy!

Clipping out the painful truth that you're a loser won't make it
magically go away, towel boy.

I'll put it back so when you're done in fantasyland you can deal with
the reality of your situation.

> You're a subliterate loser who has never amounted to anything and you
> never will. You live off your family and wife's generosity (which
> won't last) and it pains you that I point that out at every
> opportunity. If you can't deal with being called a loser, stop being
> a loser, towel boy. The choice has always been yours.

Have a nice day.

--
"Their are plenty of philanthropist you can buy from dipshit."
--Go Mavs, 7-27-2007


Go Mavs

7/30/2007 4:23:00 AM

0


"Nebuchadnezzar II" <Nebuchadnezzar@microsoft.com> wrote in message
news:2pdri.1115$vW.315@trnddc08...
> "Go Mavs" <Mav@ericks.com> wrote in message
> news:Fjdri.1495$2c6.427@trnddc01...
>> You're a subliterate loser who has never amounted to anything and you
>> never will. You live off your family and wife's generosity (which won't
>> last) and it pains you that I point that out at every opportunity. If
>> you can't deal with being called a loser, stop being a loser, towel boy.
>> The choice has always been yours.

LOL , what can I say.. you have me pegged. You have found my weakspot... You
caught me!
Ha Ha Ha!



>
> Have a nice day.
>
> --
> "Their are plenty of philanthropist you can buy from dipshit."
> --Go Mavs, 7-27-2007
>


I Approve This Nym

7/30/2007 4:51:00 AM

0


"Go Away, Mavs" <Mav@ericks.com> wrote in message
news:LIdri.5404$Ya1.5007@trnddc06...
>
> "Nebuchadnezzar II" <Nebuchadnezzar@microsoft.com> wrote in message
> news:2pdri.1115$vW.315@trnddc08...
>> "Go Mavs" <Mav@ericks.com> wrote in message
>> news:Fjdri.1495$2c6.427@trnddc01...
>>> You're a subliterate loser who has never amounted to anything and you
>>> never will. You live off your family and wife's generosity (which won't
>>> last) and it pains you that I point that out at every opportunity. If
>>> you can't deal with being called a loser, stop being a loser, towel boy.
>>> The choice has always been yours.
>
> LOL , what can I say.. you have me pegged. You have found my weakspot...
> You caught me!
> Ha Ha Ha!

Laugh now, pay later.


Nebuchadnezzar II

7/30/2007 4:52:00 AM

0

"Go Mavs" <Mav@ericks.com> wrote in message
news:LIdri.5404$Ya1.5007@trnddc06...
>
> "Nebuchadnezzar II" <Nebuchadnezzar@microsoft.com> wrote in message
> news:2pdri.1115$vW.315@trnddc08...
>> "Go Mavs" <Mav@ericks.com> wrote in message
>> news:Fjdri.1495$2c6.427@trnddc01...
>>> You're a subliterate loser who has never amounted to anything and
>>> you never will. You live off your family and wife's generosity
>>> (which won't last) and it pains you that I point that out at every
>>> opportunity. If you can't deal with being called a loser, stop
>>> being a loser, towel boy. The choice has always been yours.
>
> LOL , what can I say.. you have me pegged. You have found my
> weakspot... You caught me!
> Ha Ha Ha!

You have a number of weak spots I didn't even mention, towel boy, but
since you brought the subject up, I'll list a few more.

1) You're a serial liar.

2) You suffer from Freudian Projection, which means you accuse others of
your own failings.

3) You're functionally illiterate.

4) You can't deal with being wrong.

5) You're completely transparent and one dimensional.

Those are just a few of your weaknesses I know about, ballboy. I'm sure
there's quite a few more.

Have a nice day.

"Their are plenty of philanthropist you can buy from dipshit."
--Go Mavs, 7-27-2007


Go Mavs

7/30/2007 5:27:00 AM

0


"Nebuchadnezzar II" <Nebuchadnezzar@microsoft.com> wrote in message
news:f8eri.7436$8u1.2552@trnddc07...
> You have a number of weak spots I didn't even mention, towel boy, but
> since you brought the subject up, I'll list a few more.
>
> 1) You're a serial liar.
>
> 2) You suffer from Freudian Projection, which means you accuse others of
> your own failings.
>
> 3) You're functionally illiterate.
>
> 4) You can't deal with being wrong.
>
> 5) You're completely transparent and one dimensional.
>
> Those are just a few of your weaknesses I know about, ballboy. I'm sure
> there's quite a few more.
>
> Have a nice day.
>
> "Their are plenty of philanthropist you can buy from dipshit."
> --Go Mavs, 7-27-2007

LOL, you're so fucking nuts, that you don't even recognize it.
Psycho analysis by way of internet eh? I am not analyzing you but you're
pretty much admitting you're psychotic!

I have also matched your IP address to several other screen names on here.
Imagine that.


Nebuchadnezzar II

7/30/2007 5:58:00 AM

0

"Go Mavs" <Mav@ericks.com> wrote in message
news:qEeri.1504$2c6.731@trnddc01...
>
> "Nebuchadnezzar II" <Nebuchadnezzar@microsoft.com> wrote in message
> news:f8eri.7436$8u1.2552@trnddc07...
>> You have a number of weak spots I didn't even mention, towel boy, but
>> since you brought the subject up, I'll list a few more.
>>
>> 1) You're a serial liar.
>>
>> 2) You suffer from Freudian Projection, which means you accuse others
>> of your own failings.
>>
>> 3) You're functionally illiterate.
>>
>> 4) You can't deal with being wrong.
>>
>> 5) You're completely transparent and one dimensional.
>>
>> Those are just a few of your weaknesses I know about, ballboy. I'm
>> sure there's quite a few more.
>>
>> Have a nice day.
>>
>> "Their are plenty of philanthropist you can buy from dipshit."
>> --Go Mavs, 7-27-2007
>
> LOL, you're so fucking nuts, that you don't even recognize it.
> Psycho analysis by way of internet eh? I am not analyzing you but
> you're pretty much admitting you're psychotic!

"analysis" assumes there's something to analyze, ballboy. I'm just
calling them as they so obviously are. If you can't deal with it, tough
shit.

>
> I have also matched your IP address to several other screen names on
> here. Imagine that.

You're awfully good at accusing others of that behavior, ballboy.

Wasn't it you that used MY screen name?

I believe it was.

See #2.

See how I can read you like a book, ballboy?

Feel free to list all the other screen names I've used, ballboy.

Good luck with that one because I never have.

I'll make a bet with you though.

If you can prove it, I'll kiss your ass and give you till noon to draw a
crowd.

If you can't, you leave the political NGs for good this time. Not like
the last time when you lied about it (see #1).

Fair enough?

--
"Their are plenty of philanthropist you can buy from dipshit."
--Go Mavs, 7-27-2007