[perl-win32-gui-users] Best way to re-draw a window full of buttons?

2008-03-21 Thread Doug Hoffman
I have a bunch of buttons on a window that use -picture .bmp images to show if the button is on or off. The data for the buttons on and off state comes from a file that changes all the time. What's the proper way to refresh the window and hence re-draw all of the button objects on the window?

Re: [perl-win32-gui-users] Button onClick event

2008-03-21 Thread Doug Hoffman
Thanks Glenn, There doesn't seem to be any gui documentaion or examples on the exact right and wrong way this should be handled. I guess it's a bit understandable why newbies like me find it confusing. :) I did play with the userdata method also and that is a pretty cool tool. I appreciate the h

Re: [perl-win32-gui-users] Button onClick event

2008-03-21 Thread Glenn W Munroe
Doug, That will work, but it breaks one of the golden rules of OO programming: don't access internal object data directly. Of course, it doesn't help that there isn't a 'Name' method! The same applies to the window handle {-handle}, incidentally. A more purist approach would be to use the U

Re: [perl-win32-gui-users] Button onClick event

2008-03-21 Thread Doug Hoffman
Thanks to all who replied. Here is the code that I received. my ($ButtonClicked, @other_params) = @_; my $ButtonName = $ButtonClicked->{-name}; Thanks to Sean for the email He was nice enough to explain the mechanics of the code above and how it fetches the button -name Here's the button add a

Re: [perl-win32-gui-users] Button onClick event, how to get button -name

2008-03-21 Thread Jeremy White
Hi, I didn't test the below, but it should help. You need to do something like: sub Button_Clicked{ my $self = shift; #$self now contains the button object - so you can call methods on it... print $self->Text(); $Main->Status3->Text($self->Name); #not sure if there is a method called n

[perl-win32-gui-users] Button onClick event, how to get button -name

2008-03-21 Thread Doug Hoffman
I have been trying to understand how to get the -name of a button that was clicked by the -onClick event, at the subroutine. I have read the win32::Gui docs over and over, read several post here and elsewhere, but I still don't get it yet. :) Please bear with me, I am trying to learn, but you kn