|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
Draw on click and refresh the window - resolvedhi
i have discovered a two valuable "secret" tutorials by "Robert May" :
Drawing (Part 1):
Drawing (Part 2) :
found also on sourceforge.net site.
this is another response to the previous "rpnoble" question with a title:
Taking action after the call to Win32::GUI::Dialog()
i will refer to the tutorial Drawing (Part 2): it contains an example about how to draw something on a click of a button, and how to refresh the screen by copying the screen to memory then from memory to screen in the refresh event if required, the example are fully documented, i wish it is encluded in the examples with the win32gui package with a name such as DrawOnClick.pl
below i will copy the codes from that example with a small variations to launch a windows with a green color, then when we click a button it will draw a sine wave function and a blue rectangle, there is also a cls button. the draw will not be erased when we cover the window with another window. the dimensions are for 640x480 screen .
use Win32::GUI; my $mw = Win32::GUI::Window->new(
); # Draw into the memory DC $mw->Show(); # Tidy up exit(0); # Validate the whole window return 1; sub click { # Erase the background - COLOR_3DFACE is the window $y = sin($x); $dc->Circle($x1, $y,$pointsize); } return; sub FormLoadColor { # Erase the background - COLOR_3DFACE is the window sub Button2_Click { __END__
------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/ |
| Free Forum Powered by Nabble | Forum Help |