Re: Tk disabling menu entries, etc.

2008-02-19 Thread MK
-> Well, I tested your script. It gains appreciable memory at each menu -> invocation. My deep cascading example, stays steady in memory use. sigh. yes, i just observed this myself w/ "top". -> ( And as a side note, this is where using -> strict comes into play. it can force closures of l

Re: Tk disabling menu entries, etc.

2008-02-17 Thread MK
On 02/17/2008 12:08:40 PM, zentara wrote: -> Yeah, dynamically generated menus would be the way to go, -> but I would watch out for memory gains everytime you invoke the menu. -> Tk isn't very good about object cleanup. i will remember and look into this. -> Another problem with dynamic menus,

Re: Tk disabling menu entries, etc.

2008-02-17 Thread MK
from zentara: -> Now you may not see the usefulness of the entryconfigure or the cget, -> but what if you had a more complex menu, and needed to dynamically -> grey out items? That is exactly what i did (the cascading menus are a recursive tree, with several hundred+ total entries dynamically

Re: Tk disabling menu entries

2008-02-12 Thread John W. Krahn
MK wrote: Amazingly, what worked in the end was simply adding -state=> 'disabled' into the actual $menu->command, hence avoiding the documented "entryconfigure" method or cget altogether but if anyone has any patience left could you explain: my $state = ($count++ & 1) ? 'normal' : 'disabled

Re: Tk disabling menu entries

2008-02-12 Thread MK
Amazingly, what worked in the end was simply adding -state=> 'disabled' into the actual $menu->command, hence avoiding the documented "entryconfigure" method or cget altogether but if anyone has any patience left could you explain: my $state = ($count++ & 1) ? 'normal' : 'disabled'; to me,

Re: Tk disabling menu entries

2008-02-12 Thread MK
On 02/12/2008 12:49:30 PM, kens wrote: -> On Feb 12, 9:48 am, [EMAIL PROTECTED] (Mk) wrote: -> > sorry, zentara, but with my perl 5.8.8 this script first produces: -> > -> > Bareword "Mainloop" not allowed while "strict subs" in use at -> > ./Tkmenuentryconfigure.pl line 25 -> > -> > And even afte

Re: Tk disabling menu entries

2008-02-12 Thread kens
On Feb 12, 9:48 am, [EMAIL PROTECTED] (Mk) wrote: > sorry, zentara, but with my perl 5.8.8 this script first produces: > > Bareword "Mainloop" not allowed while "strict subs" in use at > ./Tkmenuentryconfigure.pl line 25 > > And even after i delete "use strict" i now get: > > Useless use of a const

Re: Tk disabling menu entries

2008-02-12 Thread Rob Dixon
MK wrote: > zentara wrote: >> [EMAIL PROTECTED] (MK) wrote: no matter where i use: $menu->entryconfigure(#,"disabled); i get: Can't locate object method "entryconfigure" via package "Tk::Menu::Cascade" unless i use it on a non-existent $menu, in which case i get: Can't call method "entry

Re: Tk disabling menu entries

2008-02-12 Thread MK
sorry, zentara, but with my perl 5.8.8 this script first produces: Bareword "Mainloop" not allowed while "strict subs" in use at ./Tkmenuentryconfigure.pl line 25 And even after i delete "use strict" i now get: Useless use of a constant in void context at ./Tkmenuentryconfigure.pl line 25

Tk disabling menu entries

2008-02-11 Thread MK
no matter where i use: $menu->entryconfigure(#,"disabled); i get: Can't locate object method "entryconfigure" via package "Tk::Menu::Cascade" unless i use it on a non-existent $menu, in which case i get: Can't call method "entryconfigure" on an undefined value Also, if i add a -command i