You can subscribe to this list here.
2001 |
Jan
(226) |
Feb
(139) |
Mar
(156) |
Apr
(95) |
May
(181) |
Jun
(166) |
Jul
(80) |
Aug
(59) |
Sep
(69) |
Oct
(83) |
Nov
(142) |
Dec
(33) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(91) |
Mar
(76) |
Apr
(113) |
May
(67) |
Jun
(68) |
Jul
(37) |
Aug
(41) |
Sep
(16) |
Oct
(135) |
Nov
(51) |
Dec
(21) |
2003 |
Jan
(37) |
Feb
(36) |
Mar
(37) |
Apr
(103) |
May
(68) |
Jun
(70) |
Jul
(77) |
Aug
(12) |
Sep
(9) |
Oct
(53) |
Nov
(88) |
Dec
(63) |
2004 |
Jan
(263) |
Feb
(106) |
Mar
(36) |
Apr
(21) |
May
(21) |
Jun
(34) |
Jul
(33) |
Aug
(34) |
Sep
(35) |
Oct
(21) |
Nov
(43) |
Dec
(63) |
2005 |
Jan
(28) |
Feb
(42) |
Mar
(29) |
Apr
(14) |
May
(41) |
Jun
(20) |
Jul
(65) |
Aug
(136) |
Sep
(41) |
Oct
(74) |
Nov
(34) |
Dec
(94) |
2006 |
Jan
(85) |
Feb
(94) |
Mar
(68) |
Apr
(103) |
May
(66) |
Jun
(51) |
Jul
(24) |
Aug
(56) |
Sep
(57) |
Oct
(85) |
Nov
(73) |
Dec
(68) |
2007 |
Jan
(59) |
Feb
(32) |
Mar
(13) |
Apr
(32) |
May
(36) |
Jun
(36) |
Jul
(64) |
Aug
(35) |
Sep
(19) |
Oct
(10) |
Nov
(13) |
Dec
(20) |
2008 |
Jan
(26) |
Feb
(41) |
Mar
(19) |
Apr
(24) |
May
(16) |
Jun
(33) |
Jul
(34) |
Aug
(4) |
Sep
(11) |
Oct
|
Nov
(26) |
Dec
(23) |
2009 |
Jan
(5) |
Feb
(2) |
Mar
(21) |
Apr
(16) |
May
(13) |
Jun
(6) |
Jul
(34) |
Aug
(2) |
Sep
(1) |
Oct
(7) |
Nov
(5) |
Dec
(24) |
2010 |
Jan
(3) |
Feb
(5) |
Mar
(6) |
Apr
(6) |
May
(14) |
Jun
(6) |
Jul
(1) |
Aug
(12) |
Sep
(10) |
Oct
(9) |
Nov
|
Dec
(2) |
2011 |
Jan
(4) |
Feb
(5) |
Mar
(30) |
Apr
(1) |
May
(2) |
Jun
(5) |
Jul
(3) |
Aug
(2) |
Sep
(3) |
Oct
|
Nov
(6) |
Dec
|
2012 |
Jan
|
Feb
(10) |
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(4) |
2013 |
Jan
(5) |
Feb
(3) |
Mar
|
Apr
(3) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(7) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(5) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Ramakanta P. <ram...@gm...> - 2010-05-03 16:30:53
|
HI I am new in perl. I have created one basic perl script to run win32 gui with threads but my gui got stock .......... can any one help me ... posted my code below main code........................... use threads; use threads::shared; use Win32::GUI (); use Win32::GUI::ThreadUtils; my $win = new Win32::GUI::Window( -name => 'MainWindow', -title => 'Thread_gui', -pos => [100,100], -size => [300,300], ); my $Win2 = new Win32::GUI::Window( -name => "W2", -title => "Timer Window", -pos => [ 150, 150 ], -size => [ 300, 200 ], -parent => $win, ); $Win2->AddButton( -name => 'START', -text => 'Start', -pos => [50, 50], -height => 35, ); $win->AddButton( -name => 'Timer', -text => 'TIMER', -pos => [10, 220], -height => 25, ); $win->AddButton( -name => 'Loop', -text => 'LOOP', -pos => [70, 220], -height => 25, ); $win->AddButton( -name => 'Stop', -text => 'STOP', -pos => [120, 220], -height => 25, ); $win->Show(); Win32::GUI::Dialog(); Win32::GUI::DoEvents(); $Win2->AddButton( -name => "Button2", -text => "Close this window", -pos => [ 10, 10 ], ); sub Button2_Click { $Win2->Hide(); } sub W2_Terminate { $Win2->Hide(); return 0; } sub Timer_Click { print " Timer clicked \n"; $Win2->Show(); my $thr1 = threads->create( \&thread1); $res =$thr1->join(); print "hello $res\n"; }; sub thread1{ my $result = 1; return ($result); }; print "Completed "; sub Loop_Click { print "Loop clicked \n"; $win ->( -activate => (1)); my $thr2 = threads->create( \&thread2); $res =$thr2->join(); print "hello $res\n"; }; sub thread2{ my $result = 2; Win32::GUI::DoEvents(); system ("perl rama.pl"); return ($result); }; sub Stop_Click { return -1;} And Rama.pl file.................below.. $i=0; while ( $i < 5 ) { print" hi ramakanta\n"; sleep 5; } Regards ramakanta |
From: Kevin M. <kej...@ho...> - 2010-04-26 09:04:43
|
Hey, If anyone is interested, I have created a Perl module for DirectX. It is still in the early stages of development, but I have released it on SourceForge here, if anyone would be interested in having a play with it and providing some feedback. So far, I have created an interface to Direct3D, DirectSound, and DirectInput. I have also managed to integrate it with Win32::GUI, which makes creating windows for a DirectX application quite simple. I haven't quite set up the project page yet, so if you wish to provide some feedback or have any questions, either send me an email, or reply to my post about my module on PerlMonks here. You'll need to build the module from source and requires the DirectX SDK. The documentation is lacking at this point, so it's probably best to just read the documentation that comes with the SDK, since the Perl interface is still quite similar to the underlying API. I hope that you find it useful. Thanks, Kevin. _________________________________________________________________ Need a new place to live? Find it on Domain.com.au http://clk.atdmt.com/NMN/go/157631292/direct/01/ |
From: Kevin M. <kej...@ho...> - 2010-04-13 09:34:00
|
Joe, A method I have used for this situation is to store the nodes of the treeview in a hash when populating the treeview, like this: my %Nodes; my $treeview = Win32::GUI::TreeView->new( -name => 'TreeView', #... ); foreach(1..9){ my $node = $treeview->InsertItem(-text => $_); $Nodes{$node} = $_; # More information about each element could also be stored in the hash } __END__ A treeview node is simply a number, which makes it simple to store and fetch from a hash. Then, you can set up a callback for the Expand or Expanding event. The Expanding event is called just before the node is expanded and can be used to prevent it by returning 0. You can use this event if you need it; otherwise use the Expand event. The callback is passed a parameter specifying which node is being expanded, which can be used to look up the element in the hash created above, like this: sub TreeView_Expand { my $node = shift; my $element = $Nodes{$node}; my %item = $TreeView->GetItem($node); # Do other processing here } __END__ I have used this method to display information in a listview when a node is selected in the treeview. I simply stored the data I wanted displayed in the hash of nodes and then displayed the data in the listview when a treeview node was clicked. Hope this helps, Kevin. > From: joe...@si... > To: per...@li... > Date: Mon, 12 Apr 2010 13:36:52 -0400 > Subject: [perl-win32-gui-users] Getting the node that's being Expanded in a TreeView > > Hi, I'm trying to find out which element of a TreeView is being expanded when someone clicks on the "+" beside it. > > The TreeView is generated dynamically from a list of lists, eg: > ( 1, 2, [ 3, 4 ], 5, [ 6, [7]] ) > yields a tree of > - 1 > - 2 > - 3 > - 4 > - 5 > - 6 > - 7 > > I've tried with the $node_Expand and $node_Expanding callbacks to identify which of the child nodes is being expanded, but I haven't been able to chase down who is expanding. > > Do I need to define a $node_Expand callback for each of the numbered nodes? Or am I missing something obvious? > > (Using ActiveState Perl 5.10.1 with their Win32::GUI 1.06 from PPM) > > --Joe > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ _________________________________________________________________ If It Exists, You'll Find it on SEEK. Australia's #1 job site http://clk.atdmt.com/NMN/go/157639755/direct/01/ |
From: Moore, J. <joe...@si...> - 2010-04-12 17:37:06
|
Hi, I'm trying to find out which element of a TreeView is being expanded when someone clicks on the "+" beside it. The TreeView is generated dynamically from a list of lists, eg: ( 1, 2, [ 3, 4 ], 5, [ 6, [7]] ) yields a tree of - 1 - 2 - 3 - 4 - 5 - 6 - 7 I've tried with the $node_Expand and $node_Expanding callbacks to identify which of the child nodes is being expanded, but I haven't been able to chase down who is expanding. Do I need to define a $node_Expand callback for each of the numbered nodes? Or am I missing something obvious? (Using ActiveState Perl 5.10.1 with their Win32::GUI 1.06 from PPM) --Joe |
From: Robert M. <rob...@us...> - 2010-04-09 08:41:07
|
On 9 April 2010 08:32, Jeremy White <jez...@ho...> wrote: > All, > I have just checked in some changes that will allow the building of > Win32::GUI with 64 bit perl. The resulting dll's are all 64 bit meaning they > run native on 64 bit machines with all the advantages (access to more memory > and increased performance). Jeremy, Thank you very much for this - I hope I will have a chance to look at it (and possibly make a 1.07 release?) in the not too distant future. Cheers, Rob. > At this stage, the changes should be considered > the first draft but so far I haven't found any issues in testing. Some of > the modules don't compile with mingw as they rely on MS frameworks such as > Win32::GUI::Grid. > I would be grateful for any reports of issues/problems. These changes have > been tested with the 64bit version of mingw not with the 64 bit version of > the Microsoft compiler, but that should also work. The changes should also > be compatible with any 32 bit compiler. > Strawberry perl has started to ship a version with a version of 64 bit mingw > built in: > > http://strawberryperl.com/download/strawberry-perl-5.12.0-RC0.0-64bit-beta-1.msi > > or: > > http://strawberryperl.com/download/strawberry-perl-5.12.0-RC0.0-64bit-beta-1.zip > > Once downloaded and installed (on a 64bit machine!) it's just a case of > getting the source from sourceforge and running Makefile.PL. If you have a > problem getting the source, drop me a mail off list and I'll email it to > you. > Cheers, > jez. > > > > > ________________________________ > Get a new e-mail account with Hotmail - Free. Sign-up now. > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > |
From: Jeremy W. <jez...@ho...> - 2010-04-09 07:32:17
|
All, I have just checked in some changes that will allow the building of Win32::GUI with 64 bit perl. The resulting dll's are all 64 bit meaning they run native on 64 bit machines with all the advantages (access to more memory and increased performance). At this stage, the changes should be considered the first draft but so far I haven't found any issues in testing. Some of the modules don't compile with mingw as they rely on MS frameworks such as Win32::GUI::Grid. I would be grateful for any reports of issues/problems. These changes have been tested with the 64bit version of mingw not with the 64 bit version of the Microsoft compiler, but that should also work. The changes should also be compatible with any 32 bit compiler. Strawberry perl has started to ship a version with a version of 64 bit mingw built in: http://strawberryperl.com/download/strawberry-perl-5.12.0-RC0.0-64bit-beta-1.msi or:http://strawberryperl.com/download/strawberry-perl-5.12.0-RC0.0-64bit-beta-1.zip Once downloaded and installed (on a 64bit machine!) it's just a case of getting the source from sourceforge and running Makefile.PL. If you have a problem getting the source, drop me a mail off list and I'll email it to you. Cheers, jez. _________________________________________________________________ http://clk.atdmt.com/UKM/go/197222280/direct/01/ Do you have a story that started on Hotmail? Tell us now |
From: mohsen a. <moh...@ya...> - 2010-04-05 08:13:08
|
Hi I Write a Script with Win32::Gui. I have problem for read from AddTextfield() with UTF8 characters. please help me. Mohsen Alizadeh Get your preferred Email name! Now you can @ymail.com and @rocketmail.com. http://mail.promotions.yahoo.com/newdomains/aa/ |
From: Kevin M. <kej...@ho...> - 2010-03-23 04:54:16
|
Peter, Your problem could be caused by the code that you added to the render sub. It would probably add some overhead to resize the viewport every frame. Try moving the code to just before the dialog loop. Also, you could try using the Win32::GUI::OpenGLFrame module created by Robert May. This module basically shortcuts all the code necessary for using OpenGL with Win32::GUI, and uses an XS interface to the required functions, instead of loading them with Win32::API. This may provide a speed increase. The module can be found on CPAN. Hope this helps, Kevin. Date: Sat, 6 Mar 2010 23:08:19 -0800 From: my_...@ya... To: per...@li... Subject: [perl-win32-gui-users] child window for opengl Hi in 14 Jul 2009 http://www.mail-archive.com/per...@li.../msg05703.html i have posted an opengl example to run from within win32gui , the example depends on kevin Marshall code posted here http://www.mail-archive.com/per...@li.../msg05673.html . the example show a popup child window in wich the opengl scene rendered. now i have tried the same example but the opengl scene will be rendered to a child window inside the main window; it is working but with one problem; the launching of the program lasts about 5 seconds before the main window appears. why is this behaviour?, since in the popup child window example the main window appears in one second only. the only adjustments i have made is : 1- adding the following lines to the render sub since the sticky child window can't be resized so the -onResize => sub {...} is not operative: glViewport(0,0,320,240); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0, 320 / 240, 0.1, 500.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); 2-adding to the child properties: -popstyle => WS_CAPTION | WS_SIZEBOX, -pushstyle => WS_CHILD, -pushexstyle => WS_EX_CLIENTEDGE, and the else of the program is the same as the first example. for convenience here is the modified program, so you can check the 5 seconds delay before the main window appears: http://rapidshare.com/files/360063815/win32gui_opengl2.pl its picture like this: http://img192.imageshack.us/img192/3226/win32guiopengl.jpg regards peter _________________________________________________________________ Get the latest jobs delivered. Sign up for SEEK Jobmail. http://clk.atdmt.com/NMN/go/157639755/direct/01/ |
From: Glenn M. <gwm...@gm...> - 2010-03-08 15:40:26
|
Ken, Rob May has written a module for creating splash screens that you may find useful: http://search.cpan.org/~robertmay/Win32-GUI-SplashScreen-0.04/<http://search.cpan.org/%7Erobertmay/Win32-GUI-SplashScreen-0.04/> Regards, Glenn Munroe On 5 March 2010 23:53, Kevin Marshall <kej...@ho...> wrote: > Ken, > > Instead of using -pushstyle, you need to use -popstyle. As for the > constants needed, you will need to use WS_CAPTION to remove the title bar > and WS_THICKFRAME to remove the window's sizing border. Here is an example: > > $splash = Win32::GUI::Window->new( > -name => 'splash', > -size => [200,200], > -popstyle => WS_CAPTION | WS_THICKFRAME, > ); > __END__ > > There are a number of other window constants that can be used when creating > a splash window. If you have the Windows SDK, you can check the > documentation for a full list. > > Hope this helps, > > Kevin. > > ------------------------------ > Date: Fri, 5 Mar 2010 14:44:24 -0500 > From: kl...@ps... > To: per...@li... > Subject: [perl-win32-gui-users] Borderless Main Window > > > Hello, > > Let me preface my question by saying that I haven’t used Win32::GUI very > much, so I might be missing something obvious. > > > > I want to create a borderless window (splash screen) and have done so using > the –style option when creating the new window. > > Unfortunately, this option is deprecated, and I get a message informing me > of that fact whenever I run the application. > > Looking at the documentation, it appeared that I could use the –pushstyle > of –addstyle option when creating the window. However, the window has a > border when either of these options is used. > > Can anyone point out the error of my ways? Actual code is below. > > Thanks, Ken Slater > > > > use strict; > > use warnings; > > use File::Basename; > > use Getopt::Long; > > use Win32::API; > > use Win32::GUI(); > > use Win32::GUI::Constants; > > > > use Win32::OLE('in'); > > > > my ( $runDir ); > > BEGIN > > { > > $runDir = Win32::GetFullPathName(dirname($0)); > > } > > > > my ($help, %options, %overridingOptions); > > $options{iniFile} = "$runDir/stayOnTop.ini"; > > > > > > my ($execname) = fileparse( "$0", '' ); > > > > sub usage > > { > > print STDERR <<USAGE; > > > > $execname ... > > > > USAGE > > return 0; > > } # end sub usage > > > > > > GetOptions( "ini=s" => \$options{iniFile}, > > "bg=s" => \$overridingOptions{backgroundFile}, > > "t=i" => \$overridingOptions{timeout}, > > "h!" => \$help, > > "help!" => \$help); > > if ( $help ) > > { > > usage; > > exit 0; > > } > > > > pullSettings(); > > > > use constant wbemFlagReturnImmediately => 0x10; > > use constant wbemFlagForwardOnly => 0x20; > > > > #------------------------------------------------------------ > > # Get height and width of display > > #------------------------------------------------------------ > > my $computer = "."; > > my $objWMIService = Win32::OLE->GetObject > > ("winmgmts:\\\\$computer\\root\\CIMV2") > > or die "WMI connection failed.\n"; > > my $colItems = $objWMIService->ExecQuery > > ("SELECT * FROM Win32_VideoController","WQL", > > wbemFlagReturnImmediately | wbemFlagForwardOnly); > > > > my ( $screenWidth, $screenHeight ); > > > > foreach my $objItem (in $colItems) > > { > > $screenWidth = $objItem->{CurrentHorizontalResolution}; > > $screenHeight = $objItem->{CurrentVerticalResolution}; > > } > > > > #------------------------------------------------------------ > > # Create GUI Window > > #------------------------------------------------------------ > > my $WS_POPUP = Win32::GUI::Constants::constant('WS_POPUP'); > > my $mw = Win32::GUI::Window->new( > > -title => 'NOBORDER (I hope)', > > -bg => 'black', > > -pos => [0,0], > > -size => [$screenWidth,$screenHeight], > > # The -stype option was added to make borderless > > # windows. Get a warning that this option is deprecated. > > -style => $WS_POPUP, > > # > > # Neither addstyle or pushstyle seem to get rid of the border > > #-addstyle => $WS_POPUP, > > #-pushstyle => $WS_POPUP, > > ); > > > > #------------------------------------------------------------ > > # Force this window to stay on top of other windows. > > #------------------------------------------------------------ > > my $HWND_TOPMOST = Win32::GUI::Constants::constant('HWND_TOPMOST'); > > my $SWP_NOSIZE = Win32::GUI::Constants::constant('SWP_NOSIZE'); > > my $SWP_NOMOVE = Win32::GUI::Constants::constant('SWP_NOMOVE'); > > > > $mw->SetWindowPos($HWND_TOPMOST,0,0,$screenWidth,$screenHeight, > > $SWP_NOSIZE|$SWP_NOMOVE); > > > > #------------------------------------------------------------ > > # Set the timer to exit this application after the specified > > # number of milliseconds. > > #------------------------------------------------------------ > > $options{timeout} = 5000 unless defined($options{timeout}); > > my $t1 = $mw->AddTimer('T1', $options{timeout}); > > > > #------------------------------------------------------------ > > # Set up the image to be displayed on the screen > > #------------------------------------------------------------ > > my $bitmap = Win32::GUI::Bitmap->new($options{backgroundFile}, > > 0,$screenWidth,$screenHeight); > > > > #create a label in which the bitmap will be placed > > my $bitmapLabel = $mw->AddLabel( > > -name => "Bitmap", > > -left => 0, > > -top => 0, > > -width => $screenWidth, > > -height => $screenHeight, > > -bitmap => $bitmap, > > ); > > > > #------------------------------------------------------------ > > # Display the window > > #------------------------------------------------------------ > > $mw->Show(); > > Win32::GUI::Dialog(); > > > > #------------------------------------------------------------ > > # Subroutine called when timer expires > > #------------------------------------------------------------ > > sub T1_Timer > > { > > exit; > > } > > > > sub pullSettings > > { > > local $/ = undef; > > open my $INIFH, '<', $options{iniFile} or do > > { > > Win32::MsgBox("FATAL: Unable to open $options{iniFile}: $^E", > > 0, "StayOnTop.pl"); > > exit; > > }; > > my $lines = <$INIFH>; > > close $INIFH; > > > > my $re = qr{<([^/][^>]+)>\s*([^<]+)}; > > %options = $lines =~ /$re/gs; > > > > foreach my $key ( keys %options ) > > { > > $options{$key} = $overridingOptions{$key} > > if defined($overridingOptions{$key}); > > } > > } > > ------------------------------ > Find out now. Link all your email accounts and social updates with > Hotmail. <http://windowslive.ninemsn.com.au/oneinbox?ocid=T162MSN05A0710G> > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > -- Glenn |
From: Ken S. <kl...@ps...> - 2010-03-08 14:21:15
|
Kevin, Thanks for the information. For some reason I had to use both -popstyle (WS_CAPTION | WS_THICKFRAME) and -pushstyle (WS_POPUP) to get it to work. Ken From: Kevin Marshall [mailto:kej...@ho...] Sent: Friday, March 05, 2010 9:54 PM To: kl...@ps...; Perl-Win32-GUI-Users List Subject: RE: [perl-win32-gui-users] Borderless Main Window Ken, Instead of using -pushstyle, you need to use -popstyle. As for the constants needed, you will need to use WS_CAPTION to remove the title bar and WS_THICKFRAME to remove the window's sizing border. Here is an example: $splash = Win32::GUI::Window->new( -name => 'splash', -size => [200,200], -popstyle => WS_CAPTION | WS_THICKFRAME, ); __END__ There are a number of other window constants that can be used when creating a splash window. If you have the Windows SDK, you can check the documentation for a full list. Hope this helps, Kevin. _____ Date: Fri, 5 Mar 2010 14:44:24 -0500 From: kl...@ps... To: per...@li... Subject: [perl-win32-gui-users] Borderless Main Window Hello, Let me preface my question by saying that I haven't used Win32::GUI very much, so I might be missing something obvious. I want to create a borderless window (splash screen) and have done so using the -style option when creating the new window. Unfortunately, this option is deprecated, and I get a message informing me of that fact whenever I run the application. Looking at the documentation, it appeared that I could use the -pushstyle of -addstyle option when creating the window. However, the window has a border when either of these options is used. Can anyone point out the error of my ways? Actual code is below. Thanks, Ken Slater use strict; use warnings; use File::Basename; use Getopt::Long; use Win32::API; use Win32::GUI(); use Win32::GUI::Constants; use Win32::OLE('in'); my ( $runDir ); BEGIN { $runDir = Win32::GetFullPathName(dirname($0)); } my ($help, %options, %overridingOptions); $options{iniFile} = "$runDir/stayOnTop.ini"; my ($execname) = fileparse( "$0", '' ); sub usage { print STDERR <<USAGE; $execname ... USAGE return 0; } # end sub usage GetOptions( "ini=s" => \$options{iniFile}, "bg=s" => \$overridingOptions{backgroundFile}, "t=i" => \$overridingOptions{timeout}, "h!" => \$help, "help!" => \$help); if ( $help ) { usage; exit 0; } pullSettings(); use constant wbemFlagReturnImmediately => 0x10; use constant wbemFlagForwardOnly => 0x20; #------------------------------------------------------------ # Get height and width of display #------------------------------------------------------------ my $computer = "."; my $objWMIService = Win32::OLE->GetObject ("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n"; my $colItems = $objWMIService->ExecQuery ("SELECT * FROM Win32_VideoController","WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly); my ( $screenWidth, $screenHeight ); foreach my $objItem (in $colItems) { $screenWidth = $objItem->{CurrentHorizontalResolution}; $screenHeight = $objItem->{CurrentVerticalResolution}; } #------------------------------------------------------------ # Create GUI Window #------------------------------------------------------------ my $WS_POPUP = Win32::GUI::Constants::constant('WS_POPUP'); my $mw = Win32::GUI::Window->new( -title => 'NOBORDER (I hope)', -bg => 'black', -pos => [0,0], -size => [$screenWidth,$screenHeight], # The -stype option was added to make borderless # windows. Get a warning that this option is deprecated. -style => $WS_POPUP, # # Neither addstyle or pushstyle seem to get rid of the border #-addstyle => $WS_POPUP, #-pushstyle => $WS_POPUP, ); #------------------------------------------------------------ # Force this window to stay on top of other windows. #------------------------------------------------------------ my $HWND_TOPMOST = Win32::GUI::Constants::constant('HWND_TOPMOST'); my $SWP_NOSIZE = Win32::GUI::Constants::constant('SWP_NOSIZE'); my $SWP_NOMOVE = Win32::GUI::Constants::constant('SWP_NOMOVE'); $mw->SetWindowPos($HWND_TOPMOST,0,0,$screenWidth,$screenHeight, $SWP_NOSIZE|$SWP_NOMOVE); #------------------------------------------------------------ # Set the timer to exit this application after the specified # number of milliseconds. #------------------------------------------------------------ $options{timeout} = 5000 unless defined($options{timeout}); my $t1 = $mw->AddTimer('T1', $options{timeout}); #------------------------------------------------------------ # Set up the image to be displayed on the screen #------------------------------------------------------------ my $bitmap = Win32::GUI::Bitmap->new($options{backgroundFile}, 0,$screenWidth,$screenHeight); #create a label in which the bitmap will be placed my $bitmapLabel = $mw->AddLabel( -name => "Bitmap", -left => 0, -top => 0, -width => $screenWidth, -height => $screenHeight, -bitmap => $bitmap, ); #------------------------------------------------------------ # Display the window #------------------------------------------------------------ $mw->Show(); Win32::GUI::Dialog(); #------------------------------------------------------------ # Subroutine called when timer expires #------------------------------------------------------------ sub T1_Timer { exit; } sub pullSettings { local $/ = undef; open my $INIFH, '<', $options{iniFile} or do { Win32::MsgBox("FATAL: Unable to open $options{iniFile}: $^E", 0, "StayOnTop.pl"); exit; }; my $lines = <$INIFH>; close $INIFH; my $re = qr{<([^/][^>]+)>\s*([^<]+)}; %options = $lines =~ /$re/gs; foreach my $key ( keys %options ) { $options{$key} = $overridingOptions{$key} if defined($overridingOptions{$key}); } } _____ Find out now. Link all your email accounts and social updates with Hotmail. <http://windowslive.ninemsn.com.au/oneinbox?ocid=T162MSN05A0710G> |
From: Peter O. <my_...@ya...> - 2010-03-07 07:35:09
|
Hi in 14 Jul 2009 http://www.mail-archive.com/per...@li.../msg05703.html i have posted an opengl example to run from within win32gui , the example depends on kevin Marshall code posted here http://www.mail-archive.com/per...@li.../msg05673.html . the example show a popup child window in wich the opengl scene rendered. now i have tried the same example but the opengl scene will be rendered to a child window inside the main window; it is working but with one problem; the launching of the program lasts about 5 seconds before the main window appears. why is this behaviour?, since in the popup child window example the main window appears in one second only. the only adjustments i have made is : 1- adding the following lines to the render sub since the sticky child window can't be resized so the -onResize => sub {...} is not operative: glViewport(0,0,320,240); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0, 320 / 240, 0.1, 500.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); 2-adding to the child properties: -popstyle => WS_CAPTION | WS_SIZEBOX, -pushstyle => WS_CHILD, -pushexstyle => WS_EX_CLIENTEDGE, and the else of the program is the same as the first example. for convenience here is the modified program, so you can check the 5 seconds delay before the main window appears: http://rapidshare.com/files/360063815/win32gui_opengl2.pl its picture like this: http://img192.imageshack.us/img192/3226/win32guiopengl.jpg regards peter |
From: Kevin M. <kej...@ho...> - 2010-03-06 02:53:56
|
Ken, Instead of using -pushstyle, you need to use -popstyle. As for the constants needed, you will need to use WS_CAPTION to remove the title bar and WS_THICKFRAME to remove the window's sizing border. Here is an example: $splash = Win32::GUI::Window->new( -name => 'splash', -size => [200,200], -popstyle => WS_CAPTION | WS_THICKFRAME, ); __END__ There are a number of other window constants that can be used when creating a splash window. If you have the Windows SDK, you can check the documentation for a full list. Hope this helps, Kevin. Date: Fri, 5 Mar 2010 14:44:24 -0500 From: kl...@ps... To: per...@li... Subject: [perl-win32-gui-users] Borderless Main Window Hello, Let me preface my question by saying that I haven’t used Win32::GUI very much, so I might be missing something obvious. I want to create a borderless window (splash screen) and have done so using the –style option when creating the new window. Unfortunately, this option is deprecated, and I get a message informing me of that fact whenever I run the application. Looking at the documentation, it appeared that I could use the –pushstyle of –addstyle option when creating the window. However, the window has a border when either of these options is used. Can anyone point out the error of my ways? Actual code is below. Thanks, Ken Slater use strict; use warnings; use File::Basename; use Getopt::Long; use Win32::API; use Win32::GUI(); use Win32::GUI::Constants; use Win32::OLE('in'); my ( $runDir ); BEGIN { $runDir = Win32::GetFullPathName(dirname($0)); } my ($help, %options, %overridingOptions); $options{iniFile} = "$runDir/stayOnTop.ini"; my ($execname) = fileparse( "$0", '' ); sub usage { print STDERR <<USAGE; $execname ... USAGE return 0; } # end sub usage GetOptions( "ini=s" => \$options{iniFile}, "bg=s" => \$overridingOptions{backgroundFile}, "t=i" => \$overridingOptions{timeout}, "h!" => \$help, "help!" => \$help); if ( $help ) { usage; exit 0; } pullSettings(); use constant wbemFlagReturnImmediately => 0x10; use constant wbemFlagForwardOnly => 0x20; #------------------------------------------------------------ # Get height and width of display #------------------------------------------------------------ my $computer = "."; my $objWMIService = Win32::OLE->GetObject ("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n"; my $colItems = $objWMIService->ExecQuery ("SELECT * FROM Win32_VideoController","WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly); my ( $screenWidth, $screenHeight ); foreach my $objItem (in $colItems) { $screenWidth = $objItem->{CurrentHorizontalResolution}; $screenHeight = $objItem->{CurrentVerticalResolution}; } #------------------------------------------------------------ # Create GUI Window #------------------------------------------------------------ my $WS_POPUP = Win32::GUI::Constants::constant('WS_POPUP'); my $mw = Win32::GUI::Window->new( -title => 'NOBORDER (I hope)', -bg => 'black', -pos => [0,0], -size => [$screenWidth,$screenHeight], # The -stype option was added to make borderless # windows. Get a warning that this option is deprecated. -style => $WS_POPUP, # # Neither addstyle or pushstyle seem to get rid of the border #-addstyle => $WS_POPUP, #-pushstyle => $WS_POPUP, ); #------------------------------------------------------------ # Force this window to stay on top of other windows. #------------------------------------------------------------ my $HWND_TOPMOST = Win32::GUI::Constants::constant('HWND_TOPMOST'); my $SWP_NOSIZE = Win32::GUI::Constants::constant('SWP_NOSIZE'); my $SWP_NOMOVE = Win32::GUI::Constants::constant('SWP_NOMOVE'); $mw->SetWindowPos($HWND_TOPMOST,0,0,$screenWidth,$screenHeight, $SWP_NOSIZE|$SWP_NOMOVE); #------------------------------------------------------------ # Set the timer to exit this application after the specified # number of milliseconds. #------------------------------------------------------------ $options{timeout} = 5000 unless defined($options{timeout}); my $t1 = $mw->AddTimer('T1', $options{timeout}); #------------------------------------------------------------ # Set up the image to be displayed on the screen #------------------------------------------------------------ my $bitmap = Win32::GUI::Bitmap->new($options{backgroundFile}, 0,$screenWidth,$screenHeight); #create a label in which the bitmap will be placed my $bitmapLabel = $mw->AddLabel( -name => "Bitmap", -left => 0, -top => 0, -width => $screenWidth, -height => $screenHeight, -bitmap => $bitmap, ); #------------------------------------------------------------ # Display the window #------------------------------------------------------------ $mw->Show(); Win32::GUI::Dialog(); #------------------------------------------------------------ # Subroutine called when timer expires #------------------------------------------------------------ sub T1_Timer { exit; } sub pullSettings { local $/ = undef; open my $INIFH, '<', $options{iniFile} or do { Win32::MsgBox("FATAL: Unable to open $options{iniFile}: $^E", 0, "StayOnTop.pl"); exit; }; my $lines = <$INIFH>; close $INIFH; my $re = qr{<([^/][^>]+)>\s*([^<]+)}; %options = $lines =~ /$re/gs; foreach my $key ( keys %options ) { $options{$key} = $overridingOptions{$key} if defined($overridingOptions{$key}); } } _________________________________________________________________ Link all your email accounts and social updates with Hotmail. Find out now. http://windowslive.ninemsn.com.au/oneinbox?ocid=T162MSN05A0710G |
From: Ken S. <kl...@ps...> - 2010-03-05 20:36:51
|
Hello, Let me preface my question by saying that I haven't used Win32::GUI very much, so I might be missing something obvious. I want to create a borderless window (splash screen) and have done so using the -style option when creating the new window. Unfortunately, this option is deprecated, and I get a message informing me of that fact whenever I run the application. Looking at the documentation, it appeared that I could use the -pushstyle of -addstyle option when creating the window. However, the window has a border when either of these options is used. Can anyone point out the error of my ways? Actual code is below. Thanks, Ken Slater use strict; use warnings; use File::Basename; use Getopt::Long; use Win32::API; use Win32::GUI(); use Win32::GUI::Constants; use Win32::OLE('in'); my ( $runDir ); BEGIN { $runDir = Win32::GetFullPathName(dirname($0)); } my ($help, %options, %overridingOptions); $options{iniFile} = "$runDir/stayOnTop.ini"; my ($execname) = fileparse( "$0", '' ); sub usage { print STDERR <<USAGE; $execname ... USAGE return 0; } # end sub usage GetOptions( "ini=s" => \$options{iniFile}, "bg=s" => \$overridingOptions{backgroundFile}, "t=i" => \$overridingOptions{timeout}, "h!" => \$help, "help!" => \$help); if ( $help ) { usage; exit 0; } pullSettings(); use constant wbemFlagReturnImmediately => 0x10; use constant wbemFlagForwardOnly => 0x20; #------------------------------------------------------------ # Get height and width of display #------------------------------------------------------------ my $computer = "."; my $objWMIService = Win32::OLE->GetObject ("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n"; my $colItems = $objWMIService->ExecQuery ("SELECT * FROM Win32_VideoController","WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly); my ( $screenWidth, $screenHeight ); foreach my $objItem (in $colItems) { $screenWidth = $objItem->{CurrentHorizontalResolution}; $screenHeight = $objItem->{CurrentVerticalResolution}; } #------------------------------------------------------------ # Create GUI Window #------------------------------------------------------------ my $WS_POPUP = Win32::GUI::Constants::constant('WS_POPUP'); my $mw = Win32::GUI::Window->new( -title => 'NOBORDER (I hope)', -bg => 'black', -pos => [0,0], -size => [$screenWidth,$screenHeight], # The -stype option was added to make borderless # windows. Get a warning that this option is deprecated. -style => $WS_POPUP, # # Neither addstyle or pushstyle seem to get rid of the border #-addstyle => $WS_POPUP, #-pushstyle => $WS_POPUP, ); #------------------------------------------------------------ # Force this window to stay on top of other windows. #------------------------------------------------------------ my $HWND_TOPMOST = Win32::GUI::Constants::constant('HWND_TOPMOST'); my $SWP_NOSIZE = Win32::GUI::Constants::constant('SWP_NOSIZE'); my $SWP_NOMOVE = Win32::GUI::Constants::constant('SWP_NOMOVE'); $mw->SetWindowPos($HWND_TOPMOST,0,0,$screenWidth,$screenHeight, $SWP_NOSIZE|$SWP_NOMOVE); #------------------------------------------------------------ # Set the timer to exit this application after the specified # number of milliseconds. #------------------------------------------------------------ $options{timeout} = 5000 unless defined($options{timeout}); my $t1 = $mw->AddTimer('T1', $options{timeout}); #------------------------------------------------------------ # Set up the image to be displayed on the screen #------------------------------------------------------------ my $bitmap = Win32::GUI::Bitmap->new($options{backgroundFile}, 0,$screenWidth,$screenHeight); #create a label in which the bitmap will be placed my $bitmapLabel = $mw->AddLabel( -name => "Bitmap", -left => 0, -top => 0, -width => $screenWidth, -height => $screenHeight, -bitmap => $bitmap, ); #------------------------------------------------------------ # Display the window #------------------------------------------------------------ $mw->Show(); Win32::GUI::Dialog(); #------------------------------------------------------------ # Subroutine called when timer expires #------------------------------------------------------------ sub T1_Timer { exit; } sub pullSettings { local $/ = undef; open my $INIFH, '<', $options{iniFile} or do { Win32::MsgBox("FATAL: Unable to open $options{iniFile}: $^E", 0, "StayOnTop.pl"); exit; }; my $lines = <$INIFH>; close $INIFH; my $re = qr{<([^/][^>]+)>\s*([^<]+)}; %options = $lines =~ /$re/gs; foreach my $key ( keys %options ) { $options{$key} = $overridingOptions{$key} if defined($overridingOptions{$key}); } } |
From: Jeremy W. <jez...@ho...> - 2010-02-25 13:57:46
|
In the past I have tried various tools to profile Win32::GUI applications and I've always been disappointed with the results... ...but I have been impressed with Devel::NYTProf: http://blog.timbunce.org/2009/12/24/nytprof-v3-worth-the-wait/ Devel::NYTProf exists as a PPM for both 5.10 and 5.8, but don't use that version (it just crashes). Download the latest version from cpan: http://search.cpan.org/~timb/Devel-NYTProf-3.01/ Enjoy! _________________________________________________________________ Do you have a story that started on Hotmail? Tell us now http://clk.atdmt.com/UKM/go/195013117/direct/01/ |
From: Kieren D. <Kie...@ha...> - 2010-02-25 10:43:32
|
> -----Original Message----- > From: az...@nu... [mailto:az...@nu...] > Sent: 25 February 2010 03:54 > To: per...@li... > Subject: [perl-win32-gui-users] Need to dynamically change the -tip > > Hi, > > I have developed a software using Win32::GUI and I need to have my > user to choose their desired language during the time when > they login > to the system. This will change not only the interface language but > also the tooltip. I don't have any problem doing so for > others but for > the -tip I've never succeeded. Hi Azlan. If you used an explicit Tooltip object instead of the -tip option, it has a special method to change the text. A Tooltip is a set of tooltips rather than a single one, so common methods (such as Text) don't work as I had expected. For example: use Win32'GUI ''; my $w = Win32'GUI'Window->new('-text', 'Window', '-size', [100, 100]); my $b = $w->AddButton('-text', 'test'); my $c = $w->AddButton('-text', 'test', '-pos', [0, 50]); my $t = $w->AddTooltip(); $t->AddTool('-text', 'Click me.', '-subclass', 1, '-window', $b); $t->AddTool('-text', 'Click me too.', '-subclass', 1, '-window', $c); $b->Change('-onClick', sub() {$t->UpdateTipText($b, 'Cliquez moi.')}); $c->Change('-onClick', sub() {$t->UpdateTipText($c, 'Cliquez moi aussi.')}); $w->Show; Win32'GUI'Dialog; The other way to change the text is to recreate the component which has the tooltip, but the above should usually be simpler. Kieron |
From: <az...@nu...> - 2010-02-25 04:22:07
|
Hi, I have developed a software using Win32::GUI and I need to have my user to choose their desired language during the time when they login to the system. This will change not only the interface language but also the tooltip. I don't have any problem doing so for others but for the -tip I've never succeeded. Example one of my button: $MAIN->AddButton( -name => 'Load_3', -text => "Load file", -size => [100, $BH], -pos =>[$LM, 223], -tabstop => 1, -tip=> "Load proxies from database" ); I can have a function to directly change the -text but not the -tip. Have tried several ways but still failed. (Strangely it works only for Notifyicon) I have also tried using Win32::GUI::Tooltip, but I can't seams to make it working. So can anyone please advise me the best way to do this. Thanking you all in advance. :) Regards, Azlan |
From: Kevin M. <kej...@ho...> - 2010-02-25 03:29:58
|
Bradley, It should be -onclick instead of -click. Also, instead of using the Change() method, use ReadOnly(1) to enable readonly and ReadOnly(0) to disable. Hope this helps, Kevin. Date: Wed, 24 Feb 2010 13:28:09 -0500 From: Bra...@bi... To: per...@li... Subject: [perl-win32-gui-users] Executing a subroutine when selecting a radio button Hi, I am trying to set up an action using radio buttons that when it is selected it changes the readonly state of the text field (see below code). This code runs but the subroutine does not work when the radio button is selected. I expect that the –click option is not doing what I want it to do. Does anyone have any suggestions on how to get the functionality that I am looking for? Cheers! #!perl -w use strict; #use warnings; use Win32::GUI(); my $w = 250; my $h = 100; my $main = Win32::GUI::Window->new( -name => 'Main', -text => 'Example Window', -width => $w, -height => $h, -resizable => 0 ); $main->AddRadioButton ( -name => 'radio_1', -pos => [10, 10], -size => [12,12], -checked => '1', -click => sub{$main->user_text->Change(-readonly => 1);}, ); $main->AddLabel( -text => "Disable Textfield", -pos => [25,10], ); $main->AddRadioButton ( -name => 'radio_2', -pos => [10, 30], -size => [12,12], -click => sub{$main->user_text->Change(-readonly => 0);}, ); $main->AddLabel( -text => "Enable Textfield", -pos => [25,30], ); $main->AddTextfield( -name => 'user_text', -pos => [110,28], -size => [60,20], -align => 'left', -readonly => 1, ); $main->Show(); Win32::GUI::Dialog(); _________________________________________________________________ Looking for a place to rent, share or buy? Find your next place with ninemsn Property http://clk.atdmt.com/NMN/go/157631292/direct/01/ |
From: Love, B. <Bra...@bi...> - 2010-02-24 18:55:00
|
Hi, I am trying to set up an action using radio buttons that when it is selected it changes the readonly state of the text field (see below code). This code runs but the subroutine does not work when the radio button is selected. I expect that the -click option is not doing what I want it to do. Does anyone have any suggestions on how to get the functionality that I am looking for? Cheers! #!perl -w use strict; #use warnings; use Win32::GUI(); my $w = 250; my $h = 100; my $main = Win32::GUI::Window->new( -name => 'Main', -text => 'Example Window', -width => $w, -height => $h, -resizable => 0 ); $main->AddRadioButton ( -name => 'radio_1', -pos => [10, 10], -size => [12,12], -checked => '1', -click => sub{$main->user_text->Change(-readonly => 1);}, ); $main->AddLabel( -text => "Disable Textfield", -pos => [25,10], ); $main->AddRadioButton ( -name => 'radio_2', -pos => [10, 30], -size => [12,12], -click => sub{$main->user_text->Change(-readonly => 0);}, ); $main->AddLabel( -text => "Enable Textfield", -pos => [25,30], ); $main->AddTextfield( -name => 'user_text', -pos => [110,28], -size => [60,20], -align => 'left', -readonly => 1, ); $main->Show(); Win32::GUI::Dialog(); |
From: Joshua N. <jo...@jo...> - 2010-01-21 23:56:52
|
When I first set out to add a BS_COMMANDLINK style button to my GUI I didn't know how hard it was going to be and how many pitfalls I would encounter. As a result of about two days of poking around I finally figured out how to get it all working. If you're new to all of this it wasn't obvious how to do it. I hope this helps anyone getting started with Win32::GUI to do some more advanced things. If this is the wrong place for this, please let me know. My System and Perl setup: ActiveState Perl 5.10.0.1004 (32-bit installed from MSI installer using all defaults) Win32::GUI 1.06 Windows 7 (64-bit but that shouldn't matter) ################################## 1. The perl.exe has to be "patched" to add a resource to it. This resource is the manifest file that tells perl to use the newer Common Controls available in Windows Vista and Windows 7 1a. NOTE: This is a very important step as the BS_COMMANDLINK style will not work and you will see a blank where the button should be and when you click you will see a checkbox appear where the far left side of the button should've been. 1b. Create a text file with the following contents: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="0.0.0.0" processorArchitecture="X86" name="Perl" type="win32" /> <description>Perl</description> <dependency><dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly></dependency> </assembly> 1c. Download Resource Hacker from here: http://angusj.com/resourcehacker/ 1d. Open ResHacker.exe 1e. File -> Open 1f. Select the perl binary from perlinstalldir\bin\perl.exe 1g. Action -> Add a New Resource 1h. Click "Open file with new resource" 1i. Select the file you created in Step 1b 1j. In Resource Type enter: 24 1k. In Resource Name enter: 1 1l. In Resrouce Language enter: 1033 1m. Click "Add Resource" 1n. File -> Save 1o. Exit Resource Hacker ################################## 2. Now for a code sample to display the button: use strict; use warnings; use Win32::GUI qw( BS_PUSHBUTTON BS_LEFT ); my $hex_BCM_SETNOTE = "0x00001609"; # You could use a constant here instead my $BCM_SETNOTE = cnvtHex2Int($hex_BCM_SETNOTE); my $hex_BS_COMMANDLINK = "0x0000000E"; # You could use a constant here instead my $BS_COMMANDLINK = cnvtHex2Int($hex_BS_COMMANDLINK); my $winMain = Win32::GUI::Window->new( -name => 'winMain', -text => "Main Window", -height => 300, -width => 300, ); my $btn1 = $winMain->AddButton( -name => 'btn1', -text => 'This is the larger text on the top', -align => 'left', -left => 30, -top => 30, -height => 100, -width => 200, -tabstop => 1, # This popstyle may not be necessary -popstyle => BS_PUSHBUTTON | BS_LEFT, # This is critical to getting the command link style button -pushstyle => $BS_COMMANDLINK, ); my $btn1_Note_ASCIItxt = "This is the smaller text below"; # This converts the ASCII txt string to a null terminated WCHAR string # The BCM_SETNOTE message requires that it be in this format my $btn1_Note_utf16null = pack "S*", unpack( "C*", $btn1_Note_ASCIItxt ), 0; # This sets the text that is below the larger bolded text in a command link # Command Links on MSDN # http://msdn.microsoft.com/en-us/library/bb775947(VS.85).aspx # Or just search MSDN for BS_COMMANDLINK # If you are curious about how SendMessage works, search the Win32 GUI site # BCM_SETNOTE is the message type that allows for setting the lower text my $ret = Win32::GUI::SendMessage($btn1, $BCM_SETNOTE, 0, $btn1_Note_utf16null); $winMain->Show(); Win32::GUI::Dialog(); # Convert a Hex number to an Integer # You get Hex values from msdn.microsoft.com for # various styles, messages, etc. sub cnvtHex2Int { my ($hex) = @_; my $oct = oct($hex) if $hex =~ /^0/; my $int = int $oct; return $int; } That's it. Now you have a window with a Command Link. This method can be used for the other button styles that are not included with Win32::GUI as well. Good luck! You can ask questions here: per...@jo... |
From: merryxmas <mer...@ya...> - 2010-01-07 08:13:13
|
Hi, the following code will draw a line advancing slowly from top left to bottom right, the condition is that i must draw it once only. so how i keep the plot from been erased when covered by other windows !!. i have tried many plans but failed. there is Update, and restore functions but it seems it is not working. after the wingui code i present a TK code to the same problem and it is working well. i wish you all a happy new year 2010 use strict; use warnings; use Win32::GUI(); our $NumberOfLinesDrawn = 0; my $Win = new Win32::GUI::Window( -left => 0, -top => 0, -width => 500, -height => 400, -name => "Window", -text => "drawing line with animation", #-onPaint => \&Draw, ); $Win->Show(); Draw(); Win32::GUI::Dialog(); sub Window_Terminate { return -1; } sub Draw { my $DC = $Win->GetDC; my $x = 0; my $y = 0; for(1..300) {$y +=1; $x +=1; $DC->SetPixel($x,$y); #slowing the plot process: my $counter = 0; while($counter<100000){$counter+=1;} Win32::GUI::DoEvents; } #$DC->Validate(); $NumberOfLinesDrawn +=1; print "$NumberOfLinesDrawn\n"; } the TK code: use warnings; use strict; use Tk; my $mw = MainWindow->new; my $x = 0; my $y = 0; my $counter=0; our $NumberOfLinesDrawn = 0; my $c = $mw->Canvas(-width => 500, -height => 500); $c ->pack; for(1..300) {$y +=1; $x +=1; $c -> createText( $x, $y, -fill => 'red', -text => '.'); $counter=0; # delay loop while ($counter <= 100000) { $counter++; } $mw->update; } $NumberOfLinesDrawn +=1; print "$NumberOfLinesDrawn\n"; MainLoop; -- View this message in context: http://old.nabble.com/updating-the-window-screen-tp27056406p27056406.html Sent from the perl-win32-gui-users mailing list archive at Nabble.com. |
From: Andrey <wa...@ma...> - 2009-12-25 05:46:16
|
Hello, Jeremy! In my main application I'm forced to have several controls with same name, because the UI is actually loads from network upon some sort of action. So the names are like Button001, Button002, ...etc. And when new UI arrives I need to get rid from all existing controls (i.e. ButtonNNN, LabelNNN etc) and create new ones. So I used Win32::GUI::DestroyWindow to remove control. But in first memleak example you told me that Win32::GUI::DestroyWindow is not necessary, I tried without it and got a complete mess - most of new controls just did not show up as shown in example below in quoted message (this is I beleive Win32::GUI bug) As for memory leak - it seems it is perl 5.10 bug, I'll install 5.8.xx to confirm. -----Original Message----- From: Jeremy White <jez...@ho...> To: <wa...@ma...>, <ily...@so...>, <per...@li...> Date: Thu, 24 Dec 2009 23:01:41 +0000 Subject: RE: [perl-win32-gui-users] label is not visible after recreating inevent > > Hi, > The reason you are seeing strange behavior is that you have several controls with the same name, give each one a unique name and the problem will go away. > For me (Vista, Perl 5.8.9, Win32::GUI 1.6) the below doesn't leak (handle or memory [i do see a 'leak' of 16K on the first run, but no more leaks on any other run after]) > use strict; use Win32::GUI qw (WM_QUERYENDSESSION); my $main = Win32::GUI::Window->new(-name => 'Main', -text => 'Perl', -width => 200, - height => 200);$main->AddLabel(-name => "Label", -text => "Hello, world", -left => 20, -top => 20, -notify => 1);$main- >Show();Win32::GUI::Dialog(); > sub Label_Click { for (1..10000) { $main->AddLabel(-name => "Label", -text => "Hello, world", -left => 20, -top => 20, -notify => 1); }} > > > > > From: wa...@ma... > > To: Ily...@so...; per...@li... > > Date: Thu, 24 Dec 2009 19:10:51 +0300 > > Subject: Re: [perl-win32-gui-users] label is not visible after recreating inevent > > > > > > Well, in my main application I need dynamically destroy/create controls. But I was told to not use DestroyWindow, because Win32::GUI "correctly" destroys control when it goes out of scope. I decided to check how Win32::GUI destroys controls when they are out of scope and wrote an example below. I do not need workaround (I already have one), I need a confirmation if it is a bug or not (if not, then why the behavior is so strange?). Try to comment one of $main->AddLabel in Label_Click and everything will be ok. This is very strange behavior, I think. > > > > It seems the program hangs in infinite loop invoking Win32::GUI::WindowProps::FETCH but I'm not yet digged deep enough to be 100% sure... > > > > -----Original Message----- > > From: "Ilya BANDORIN" <Ily...@so...> > > To: "perl-win32-gui-users" <per...@li...> > > Date: Thu, 24 Dec 2009 18:53:36 +0300 > > Subject: Re: [perl-win32-gui-users] label is not visible after recreating > > inevent > > > > > Probably because the control named "Label" is alredy defined in main code. Why do you try to create it once more? > > > You should just modify its properties (text), something like this: > > > > > > $main->Label->Text(rand()); > > > > > > > > > > > > -----Original Message----- > > > From: Andrey [mailto:wa...@ma...] > > > Sent: Thursday, December 24, 2009 6:07 PM > > > To: perl-win32-gui-users > > > Subject: [perl-win32-gui-users] label is not visible after recreating inevent > > > > > > > > > While researching memory leak in Win32::GUI I found out strange behavior of control. > > > > > > Here is an example: > > > > > > ===================== > > > use strict; > > > use Win32::GUI(); > > > > > > my $main = Win32::GUI::Window->new(-name => 'Main', -text => 'Perl', -width => 200, -height => 200); > > > > > > $main->AddLabel(-name => "Label", -text => "Hello, world", -left => 20, -top => 20, -notify => 1); > > > > > > sub Label_Click > > > { > > > { # "visibility" block > > > $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); > > > $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); > > > } > > > $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); > > > } > > > > > > $main->Show(); Win32::GUI::Dialog(); > > > > > > sub Main_Terminate { -1; } > > > ======================= > > > > > > When you click on "Hello, world" label it just disappears. > > > If you comment any of "$main->AddLabel" lines then everything will be OK. > > > Why label disappears? > > > > > > Perl version: 5.10.1 build 1006 > > > Win32::GUI version: 1.06 > > > > > > > > > ------------------------------------------------------------------------------ > > > This SF.Net email is sponsored by the Verizon Developer Community > > > Take advantage of Verizon's best-in-class app development support > > > A streamlined, 14 day to market process makes app distribution fast and easy > > > Join now and get one step closer to millions of Verizon customers > > > http://p.sf.net/sfu/verizon-dev2dev > > > _______________________________________________ > > > Perl-Win32-GUI-Users mailing list > > > Per...@li... > > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > http://perl-win32-gui.sourceforge.net/ > > > ------------------------------------------------------------------------------ > > > This SF.Net email is sponsored by the Verizon Developer Community > > > Take advantage of Verizon's best-in-class app development support > > > A streamlined, 14 day to market process makes app distribution fast and easy > > > Join now and get one step closer to millions of Verizon customers > > > http://p.sf.net/sfu/verizon-dev2dev > > > _______________________________________________ > > > Perl-Win32-GUI-Users mailing list > > > Per...@li... > > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > http://perl-win32-gui.sourceforge.net/ > > > > > > > ------------------------------------------------------------------------------ > > This SF.Net email is sponsored by the Verizon Developer Community > > Take advantage of Verizon's best-in-class app development support > > A streamlined, 14 day to market process makes app distribution fast and easy > > Join now and get one step closer to millions of Verizon customers > > http://p.sf.net/sfu/verizon-dev2dev > > _______________________________________________ > > Perl-Win32-GUI-Users mailing list > > Per...@li... > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > http://perl-win32-gui.sourceforge.net/ > > _________________________________________________________________ > Have more than one Hotmail account? Link them together to easily access both > http://clk.atdmt.com/UKM/go/186394591/direct/01/ > |
From: Jeremy W. <jez...@ho...> - 2009-12-24 23:01:48
|
Hi, The reason you are seeing strange behavior is that you have several controls with the same name, give each one a unique name and the problem will go away. For me (Vista, Perl 5.8.9, Win32::GUI 1.6) the below doesn't leak (handle or memory [i do see a 'leak' of 16K on the first run, but no more leaks on any other run after]) use strict; use Win32::GUI qw (WM_QUERYENDSESSION); my $main = Win32::GUI::Window->new(-name => 'Main', -text => 'Perl', -width => 200, -height => 200);$main->AddLabel(-name => "Label", -text => "Hello, world", -left => 20, -top => 20, -notify => 1);$main->Show();Win32::GUI::Dialog(); sub Label_Click { for (1..10000) { $main->AddLabel(-name => "Label", -text => "Hello, world", -left => 20, -top => 20, -notify => 1); }} > From: wa...@ma... > To: Ily...@so...; per...@li... > Date: Thu, 24 Dec 2009 19:10:51 +0300 > Subject: Re: [perl-win32-gui-users] label is not visible after recreating inevent > > > Well, in my main application I need dynamically destroy/create controls. But I was told to not use DestroyWindow, because Win32::GUI "correctly" destroys control when it goes out of scope. I decided to check how Win32::GUI destroys controls when they are out of scope and wrote an example below. I do not need workaround (I already have one), I need a confirmation if it is a bug or not (if not, then why the behavior is so strange?). Try to comment one of $main->AddLabel in Label_Click and everything will be ok. This is very strange behavior, I think. > > It seems the program hangs in infinite loop invoking Win32::GUI::WindowProps::FETCH but I'm not yet digged deep enough to be 100% sure... > > -----Original Message----- > From: "Ilya BANDORIN" <Ily...@so...> > To: "perl-win32-gui-users" <per...@li...> > Date: Thu, 24 Dec 2009 18:53:36 +0300 > Subject: Re: [perl-win32-gui-users] label is not visible after recreating > inevent > > > Probably because the control named "Label" is alredy defined in main code. Why do you try to create it once more? > > You should just modify its properties (text), something like this: > > > > $main->Label->Text(rand()); > > > > > > > > -----Original Message----- > > From: Andrey [mailto:wa...@ma...] > > Sent: Thursday, December 24, 2009 6:07 PM > > To: perl-win32-gui-users > > Subject: [perl-win32-gui-users] label is not visible after recreating inevent > > > > > > While researching memory leak in Win32::GUI I found out strange behavior of control. > > > > Here is an example: > > > > ===================== > > use strict; > > use Win32::GUI(); > > > > my $main = Win32::GUI::Window->new(-name => 'Main', -text => 'Perl', -width => 200, -height => 200); > > > > $main->AddLabel(-name => "Label", -text => "Hello, world", -left => 20, -top => 20, -notify => 1); > > > > sub Label_Click > > { > > { # "visibility" block > > $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); > > $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); > > } > > $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); > > } > > > > $main->Show(); Win32::GUI::Dialog(); > > > > sub Main_Terminate { -1; } > > ======================= > > > > When you click on "Hello, world" label it just disappears. > > If you comment any of "$main->AddLabel" lines then everything will be OK. > > Why label disappears? > > > > Perl version: 5.10.1 build 1006 > > Win32::GUI version: 1.06 > > > > > > ------------------------------------------------------------------------------ > > This SF.Net email is sponsored by the Verizon Developer Community > > Take advantage of Verizon's best-in-class app development support > > A streamlined, 14 day to market process makes app distribution fast and easy > > Join now and get one step closer to millions of Verizon customers > > http://p.sf.net/sfu/verizon-dev2dev > > _______________________________________________ > > Perl-Win32-GUI-Users mailing list > > Per...@li... > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > http://perl-win32-gui.sourceforge.net/ > > ------------------------------------------------------------------------------ > > This SF.Net email is sponsored by the Verizon Developer Community > > Take advantage of Verizon's best-in-class app development support > > A streamlined, 14 day to market process makes app distribution fast and easy > > Join now and get one step closer to millions of Verizon customers > > http://p.sf.net/sfu/verizon-dev2dev > > _______________________________________________ > > Perl-Win32-GUI-Users mailing list > > Per...@li... > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > http://perl-win32-gui.sourceforge.net/ > > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ _________________________________________________________________ Have more than one Hotmail account? Link them together to easily access both http://clk.atdmt.com/UKM/go/186394591/direct/01/ |
From: Brian M. <bmi...@hu...> - 2009-12-24 22:05:54
|
On 12/23/2009 07:19 AM, Seb wrote: How about running your script as a Windows Service? If you need, I'll dig up an example for you. As a service, you can't have a GUI, but it can communicate over a network. Brian > Hi folks, > > > Here is the question: I'm looking for a minimal example of a (perl) script > that dies (gracefully or not) when Windows tries to shutdown. > > Story: I have developed an application that monitors via RS232 the health > of TV screens attached to PCs. The information gathered is relayed to a > central server. This application must run continuously, but still die > when an automatic shutdown is triggered on the PC. The application works > but doesn't die when asked to (via Start->Stop). > > I have a fair knowledge of Perl and Unix, but I am totally new to Windows > programming: don't hesitate to state an obvious solution :-) Please note > that the application does not in itself require a GUI. I tried a GUI > following the discussion here: > http://objectmix.com/perl/20692-win32-how-quit-perl-script-during-log-off-automatically.html > A solution that would use Win32::API would also work for me, I just > thought it might be simpler with Win32::GUI. > I have tried to use GetMessage and PeekMessage, but I'm clearly not using > them the right way (again, I know zilsch about Windows programming). > > I've read the archives on mail-archive.com and found discussions dating > back to 2001 and 2004; they do not provide a working example alas. I also > tried to understand the man pages on CPAN and the samples in the tarball, > but couldn't find a hint there either. > > Any hope, err, help, would be much appreciated! > > > Seb. > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > |
From: Andrey <wa...@ma...> - 2009-12-24 16:11:05
|
Well, in my main application I need dynamically destroy/create controls. But I was told to not use DestroyWindow, because Win32::GUI "correctly" destroys control when it goes out of scope. I decided to check how Win32::GUI destroys controls when they are out of scope and wrote an example below. I do not need workaround (I already have one), I need a confirmation if it is a bug or not (if not, then why the behavior is so strange?). Try to comment one of $main->AddLabel in Label_Click and everything will be ok. This is very strange behavior, I think. It seems the program hangs in infinite loop invoking Win32::GUI::WindowProps::FETCH but I'm not yet digged deep enough to be 100% sure... -----Original Message----- From: "Ilya BANDORIN" <Ily...@so...> To: "perl-win32-gui-users" <per...@li...> Date: Thu, 24 Dec 2009 18:53:36 +0300 Subject: Re: [perl-win32-gui-users] label is not visible after recreating inevent > Probably because the control named "Label" is alredy defined in main code. Why do you try to create it once more? > You should just modify its properties (text), something like this: > > $main->Label->Text(rand()); > > > > -----Original Message----- > From: Andrey [mailto:wa...@ma...] > Sent: Thursday, December 24, 2009 6:07 PM > To: perl-win32-gui-users > Subject: [perl-win32-gui-users] label is not visible after recreating inevent > > > While researching memory leak in Win32::GUI I found out strange behavior of control. > > Here is an example: > > ===================== > use strict; > use Win32::GUI(); > > my $main = Win32::GUI::Window->new(-name => 'Main', -text => 'Perl', -width => 200, -height => 200); > > $main->AddLabel(-name => "Label", -text => "Hello, world", -left => 20, -top => 20, -notify => 1); > > sub Label_Click > { > { # "visibility" block > $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); > $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); > } > $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); > } > > $main->Show(); Win32::GUI::Dialog(); > > sub Main_Terminate { -1; } > ======================= > > When you click on "Hello, world" label it just disappears. > If you comment any of "$main->AddLabel" lines then everything will be OK. > Why label disappears? > > Perl version: 5.10.1 build 1006 > Win32::GUI version: 1.06 > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > |
From: Ilya B. <Ily...@so...> - 2009-12-24 15:53:52
|
Probably because the control named "Label" is alredy defined in main code. Why do you try to create it once more? You should just modify its properties (text), something like this: $main->Label->Text(rand()); -----Original Message----- From: Andrey [mailto:wa...@ma...] Sent: Thursday, December 24, 2009 6:07 PM To: perl-win32-gui-users Subject: [perl-win32-gui-users] label is not visible after recreating inevent While researching memory leak in Win32::GUI I found out strange behavior of control. Here is an example: ===================== use strict; use Win32::GUI(); my $main = Win32::GUI::Window->new(-name => 'Main', -text => 'Perl', -width => 200, -height => 200); $main->AddLabel(-name => "Label", -text => "Hello, world", -left => 20, -top => 20, -notify => 1); sub Label_Click { { # "visibility" block $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); } $main->AddLabel(-name => "Label", -text => rand(), -left => 20, -top => 20, -notify => 1); } $main->Show(); Win32::GUI::Dialog(); sub Main_Terminate { -1; } ======================= When you click on "Hello, world" label it just disappears. If you comment any of "$main->AddLabel" lines then everything will be OK. Why label disappears? Perl version: 5.10.1 build 1006 Win32::GUI version: 1.06 ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/ |