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: Zuhair k. <zi...@gm...> - 2009-04-17 16:12:11
|
Hi, there is an error talking about an undefined subroutine at line 623, if you try to save, i've fix it. The error was: $file = GUI::GetOpenFileName [...], instead of Win32::GUI::GetOpenFileName. -- View this message in context: http://www.nabble.com/GUI-Builder-%28gb109%29-tp15762632p23100783.html Sent from the perl-win32-gui-users mailing list archive at Nabble.com. |
From: Waldemar B. <wb...@sa...> - 2009-03-26 18:58:49
|
Hello! I was searching in the Internet but without any result. Is it possibly in Perl - Win32::GUI make menu with user defined font (family, style, weight and size)? Any pointer or example would make me happy! Waldemar. |
From: Patrick R. <pat...@qw...> - 2009-03-23 15:37:08
|
Hi, I'm having some issues with a Textfield, but I seem to have narrowed most of them down to a problem with GetLine(). GetLine() seems to be only getting the first 24 characters of a line. After appending a bunch of output to the Textfield, I can use this to get some of the lines. foreach $item (0..50) { $line = $program_output->GetLine($item); print "Line $item: $line\n"; } This prints out (in part): Line 0: Some text4653630 Line 1: gswin32c.exe -dSAFER -dB Line 2: -sDEVICE=tiffg4 -sOutput Line 3: C:\Working\19390B4-1DOC. Line 4: (2008-08-01) Line 5: Copyright (C) 2008 Artif Line 6: This software comes with Line 7: PUBLIC for details. Line 8: Processing pages 1 throu Line 9: Page 1 The Textfield shows this: (note that this is the word wrapped output) Some text4653630 gswin32c.exe -dSAFER -dBATCH -dNOPAUSE -r300 -sDEVICE=tiffg4 -sOutputFile=Tester.tif C:\Working\19390B4-1DOC.pdfGPL Ghostscript 8.63 (2008-08-01) Copyright (C) 2008 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Processing pages 1 through 319. Page 1 Don't know if it's relevant, but here's the code for the Textfield: my $program_output = $main->AddTextfield ( -name => "Output", -notify => 1, -pos => [319,175], -size => [316,229], -multiline => 1, -autohscroll => 0, -vscroll => 1, -autovscroll => 1, -visible => 1, ); Any ideas on how to get GetLine to work? Thanks, Pat Roden |
From: Jeremy W. <jez...@ho...> - 2009-03-21 10:53:36
|
As a side, you dont need to define constants or use win32 api: use strict; use warnings; use Win32::GUI qw(WS_CAPTION TME_HOVER TME_LEAVE HOVER_DEFAULT SWP_FRAMECHANGED SWP_NOMOVE SWP_NOSIZE SWP_NOZORDER SWP_NOACTIVATE); my $state = 0; # 0 - out; 1 - in; my $mw = Win32::GUI::Window->new( -title => "Vanishing Title Bar", -pos => [100,100], -size => [400,300], -onMouseOver => sub {print "Hover\n"; return 0;}, -onMouseOut => \&Out, -onMouseMove => \&Move, ); $mw->Show(); Win32::GUI::Dialog(); exit(0); sub Out { print "Out\n"; $mw->Change(-pushstyle => WS_CAPTION), $mw->SetWindowPos(0, 0, 0, 0, 0,SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE); $state = 0; return 0; } sub Move { return unless $state == 0; $mw->Change(-popstyle => WS_CAPTION), $mw->SetWindowPos( 0, 0, 0, 0, 0,SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE); print "In\n"; $state = 1; $mw->TrackMouse(1000,TME_HOVER|TME_LEAVE); return 1; } > From: wb...@sa... > To: per...@li...; jez...@ho... > Subject: Re: [perl-win32-gui-users] I need mouse method! > Date: Sat, 21 Mar 2009 11:17:05 +0100 > > > Oh Jeremy, > > you are perfectly right! I am so inpatient! > > Thank you for your help! > > Waldemar. _________________________________________________________________ All your Twitter and other social updates in one place http://clk.atdmt.com/UKM/go/137984870/direct/01/ |
From: Waldemar B. <wb...@sa...> - 2009-03-21 10:18:38
|
Oh Jeremy, you are perfectly right! I am so inpatient! Thank you for your help! Waldemar. |
From: Jeremy W. <jez...@ho...> - 2009-03-21 07:44:08
|
> I have found in Internet the following code (later on), but I don't see any efects of MouseOver at all. Specialy it does not print the words: "Hover" when I put my mouse over the window. Can anyone help me? I use Perl 5.8. > > the code: Hi, I am not sure if I understand what you want to do - but that code worked for me (I see the word hover when the mouse is stationary for a second or two). Vista, perl v5.8.9 and the latest version of Win32::GUI. Cheers, Jeremy. _________________________________________________________________ View your Twitter and Flickr updates from one place – Learn more! http://clk.atdmt.com/UKM/go/137984870/direct/01/ |
From: Waldemar B. <wb...@sa...> - 2009-03-20 22:31:14
|
Hi All! Is anybody know how to get the following result: The best I want to make left mouse button pressed and then get series event send to the application. Quite similar to that of onMouseMove events. I noticed that the system knows the event onMouseOver, but it does not perform any method. Here is my button where onMouseMove acts whereas onMouseOver doesn't: my $b = $mw->AddButton( -name=> 'name', -pos => [ $left , $top ], -size => [ $width, $height ], -popstyle => WS_CAPTION | WS_EX_TRANSPARENT | WS_SYSMENU | WS_THICKFRAME | WS_BORDER, -remexstyle => WS_EX_CLIENTEDGE, -onMouseDown => \&::mousedown, -onMouseRightDown => \&::mouserightdown, -onMouseRightUp => \&::mouserightup, -onMouseOver => \&::mouseover, -onMouseMove => \&::mousemove, ); I have found in Internet the following code (later on), but I don't see any efects of MouseOver at all. Specialy it does not print the words: "Hover" when I put my mouse over the window. Can anyone help me? I use Perl 5.8. the code: #!perl -w use strict; use warnings; use Win32::API; use Win32::GUI qw(WS_CAPTION); my $SetWindowPos = Win32::API->new("user32","SetWindowPos", "LLLLLLL", "L") or die "Failed to load SetWindowPos"; sub TME_HOVER() {1} sub TME_LEAVE() {2} sub HOVER_DEFAULT() {0xFFFFFFFF} sub SWP_FRAMECHANGED() {32} sub SWP_NOMOVE() {2} sub SWP_NOSIZE() {1} sub SWP_NOZORDER() {4} sub SWP_NOACTIVATE() {16} my $state = 0; # 0 - out; 1 - in; my $mw = Win32::GUI::Window->new( -title => "Vanishing Title Bar", -pos => [100,100], -size => [400,300], -onMouseOver => sub {print "Hover\n"; return 0;}, -onMouseOut => \&Out, -onMouseMove => \&Move, ); $mw->Show(); Win32::GUI::Dialog(); exit(0); sub Out { print "Out\n"; $mw->Change(-pushstyle => WS_CAPTION), $SetWindowPos->Call($mw->{-handle}, 0, 0, 0, 0, 0, SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE); $state = 0; return 0; } sub Move { return unless $state == 0; $mw->Change(-popstyle => WS_CAPTION), $SetWindowPos->Call($mw->{-handle}, 0, 0, 0, 0, 0, SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE); print "In\n"; $state = 1; $mw->TrackMouse(1000,TME_HOVER|TME_LEAVE); return 1; } |
From: merryxmas <mer...@ya...> - 2009-03-14 13:13:11
|
hello the following code will show a msgbox before the Form appears on the screen, i wonder if it is possible to show the msgbox after the Form appears on the screen automatically. use Win32::GUI; $Win = new Win32::GUI::Window( -left => 3, -top => 5, -width => 640, -height => 480, -name => "Win", -run => &message, ); $Win->Show(); Win32::GUI::Dialog(); sub Win_Terminate { return -1; } sub message { $msg = "hello"; Win32::GUI::MessageBox($mw,$msg,".",MB_OK); } -- View this message in context: http://www.nabble.com/call-a-subroutine-after-the-Form-appearance-tp22512510p22512510.html Sent from the perl-win32-gui-users mailing list archive at Nabble.com. |
From: Raphael S. <win...@ra...> - 2009-03-13 23:25:40
|
Hi Jeremy Thanks much for the hint. The sample-program is now 100%-non-flickering. The style => 0, made it. So the DC-issue is fully solved. Is there also such a simple trick to prevent the flickering of the other window-elements, while resizing? Near some Buttons and lables, I have two richedit-fields and two bitmaps into my window. These elements flashes still while resizing. And the noflicker-option breaks my (modified) richedit-flieds (they looks like disabled, text is disappearing etc). It's a little bit annoying, because the RE's are pretty big. Thanks a lot. Greetings, Raphael ________________________________________ Von: Jeremy White [mailto:jez_white@....com] Gesendet: Freitag, 13. März 2009 20:08 An: win...@ra...; per...@li... Betreff: RE: [perl-win32-gui-users] WG: flickering static-DC Hi, It's not a Win32-GUI problem either - it's a windows thing. When a window is resized windows clears the area *before* the paint event is fired, resulting in that flash/flicker. You can work around this by associating a class to the window (which, I think, from memory stops the event that clears the window): my $WC = new Win32::GUI::Class( -name => "test", -style => 0, ); then: $WIN = new Win32::GUI::Window( -left => 200, -top => 200, -width => 300, -height => 300, -name => "WIN", -text => "Static-DC-Test v3", -class => $WC, #-noflicker => 1, # Will not work with the Paint-event ); and that should stop the flicker. I didn't test the above, but it should work:) Cheers, Jeremy. > From: win...@ra... > To: per...@li... > Date: Fri, 13 Mar 2009 13:33:05 +0100 > Subject: [perl-win32-gui-users] WG: flickering static-DC > > Hi @ all > > Here is a sample-programm for displaying a static DC over a memory-DC. > The sample is adapted from 'Region.pl'. > Flickering while moving the window, or moving an other window over the DC is > gone. Only while resizing the window, flickering appears. I think that is > not a DC-problem, but a win32-gui-problem > > ----------------- > # proper displaying and refreshing of a static DC > # Please see the demo 'Region.pl' for further explanations > use strict; > use Win32::GUI(); > our $WIN; > our %DC; > our @DATA; # Sample Data for the graph > > $DATA[0] = {'x' => 10, 'y' => 100}; > $DATA[1] = {'x' => 50, 'y' => 30}; > $DATA[2] = {'x' => 90, 'y' => 200}; > $DATA[3] = {'x' => 130, 'y' => 180}; > $DATA[4] = {'x' => 170, 'y' => 210}; > $DATA[5] = {'x' => 210, 'y' => 150}; > > &build_gui; # Inizialize program > Win32::GUI::Dialog(); > > sub build_gui # Building the GUI > { > $WIN = new Win32::GUI::Window( > -left => 200, -top => 200, -width => 300, -height => 300, > -name => "WIN", > -text => "Static-DC-Test v3", > #-noflicker => 1, # Will not work with the Paint-event > ); > $WIN->Show(); > # Defining the DC-styles > $DC{'color'}{'white'} = [255,255,255]; > $DC{'color'}{'red'} = [255,0,0]; > $DC{'color'}{'grey'} = [100,100,100]; > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > 3, ); > $DC{'grid'} = new Win32::GUI::Pen( -color => $DC{'color'}{'grey'}, -width => > 1, ); > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > -width => 1, ); > &repaint; # Generate the DC (first time) > } > > sub WIN_Terminate { return -1; } > > sub WIN_Paint # re-/paint-event of the window > { &repaint; } > > sub repaint # Create/rebuild DC-Object > { > # preparing the DC (memory-DC) > $DC{'dc'}{'object'} = $WIN -> GetDC; # Creating DC > $DC{'dc'}{'mem_object'} = $DC{'dc'}{'object'} -> CreateCompatibleDC(); # > Creating compatible DC > $DC{'dc'}{'bitmap'} = $DC{'dc'}{'object'} -> > CreateCompatibleBitmap(250,250); # Creating compatible Bitmap > $DC{'dc'}{'old_bitmap'} = $DC{'dc'}{'mem_object'} -> > SelectObject($DC{'dc'}{'bitmap'}); # Selecting the bitmap into the new DC > > # Drawing into the memory-DC > $DC{'dc'}{'mem_object'} -> FillRect(10, 10, 260, 260,$DC{'brush'}); > $DC{'dc'}{'mem_object'} -> SelectObject($DC{'grid'}); > for (my $i = 10;$i < 270; $i+=24) # Create y-grid > {$DC{'dc'}{'mem_object'} -> Line(10,$i,250,$i);} > for (my $i = 10;$i < 280; $i+=24) # Create x-grid > {$DC{'dc'}{'mem_object'} -> Line($i,10,$i,260);} > > $DC{'dc'}{'mem_object'} -> SelectObject($DC{'pen'}); > $DC{'dc'}{'mem_object'} -> BeginPath(); > $DC{'dc'}{'mem_object'} -> MoveTo($DATA[0]{'x'}, $DATA[0]{'y'}); # Create > graph (first point) > for (my $i = 1;$i < scalar @DATA;$i++) > { $DC{'dc'}{'mem_object'} -> LineTo($DATA[$i]{'x'}, $DATA[$i]{'y'}); } # > Steps > $DC{'dc'}{'mem_object'} -> EndPath(); > $DC{'dc'}{'mem_object'} -> StrokePath(); > > $DC{'dc'}{'object'} -> BitBlt(10, 10, 250,250,$DC{'dc'}{'mem_object'}, 10, > 10); # Updating the screen > $DC{'dc'}{'mem_object'} -> SelectObject($DC{'dc'}{'old_bitmap'}); # > Restoring original bitmap > $DC{'dc'}{'mem_object'} -> DeleteDC(); # Removing the memory-DC > } > ----------------- > Hope, the mail-linebreaks don't messing up the code > > Greetings, > Raphael > > -----Ursprüngliche Nachricht----- > Von: Raphael Stoeckli [mailto:win32gui@....ch] > Gesendet: Mittwoch, 11. März 2009 00:53 > An: 'zak3' > Cc: per...@li... > Betreff: Re: [perl-win32-gui-users] flickering static-DC > > Hi Zak > > I run probably an old version of ASPerl (5.8.6.811). There is an error, when > I try to run test8.pl or test13.pl. Hook Perl_newXS_flags was not found in > perl58.dll. I think, I remained on 5.8.6.811, because of some > PAR-compatibility-issues (most likely obsolote now). I will try it on an > other machine with 5.8.8 or 5.10 the next days. > My program works now pretty good, without much flickering, only with > win32-GUI-corefunctions. I will also try to move my window-DC into a > memory-DC the next days, as I said in my last post. I will post some > sample-code when I finished that. > To tell the truth, DIBitmap and GD frighten me a little bit. Is not that I > don't understand it already worked with DIBitmap intensively. But my > program will be a standalone-binary for PCs without Perl. Even though > 1TB-HDDs are on the advance, I am still skeptic if I have a binary of more > than 3 or 4 MB in front of me, to run a really simple program. Maybe I am > too conservative :-) > > Anyhow, much thanks for your hint. I will also study the two posts from > mail-archive.com. > > Greetings, > Raphael > > -----Ursprüngliche Nachricht----- > Von: zak3 [mailto:zak31415@.....com] > Gesendet: Montag, 9. März 2009 12:57 > An: per...@li... > Betreff: Re: [perl-win32-gui-users] flickering static-DC > > > Hi > also look to this link about drawing and refreshing: > http://www.nabble.com/Draw-on-click-and-refresh-the-window---resolved-td1809 > 3899.html > and the two tutorials by rob may about drawing and refreshing: > http://www.mail-archive.com/per...@li.../msg05 > 194.html > http://www.mail-archive.com/per...@li.../msg05 > 195.html > > also before three days i have found an example in the win32gui demos : > demos\DIBitmap\ the first is test8.pl and test13.pl they draw a circle > without any flickering, they use GD graphics with DIBitmap, first install GD > Graphics from this site:http://www.bribes.org/perl/ppmdir.html > using the command: > ppm install http://www.bribes.org/perl/ppm/GD.ppd > and try the test8.pl and test13.pl, the GD graphics have many plotting > statements for drawing lines, polygons, points, etc > > > Raphael Stoeckli wrote: > > > > Hi @ all > > > > I try to plot a static DC-Object (means: the graphic is calculated > > uniquely > > at runtime, depending of several parameters, and does not change while > > displaying the window) in a window. > > The problem is that this object continuously needs to be redrawn, because > > it > > vanishes during moving the window around, or if an other window is moving > > over it. > > I thought, a repaint-routine like that would solve the problem: > > ------------------------------------- > > use strict; > > use Win32::GUI(); > > our $WIN; > > our %DC; > > > > &build_gui; > > Win32::GUI::Dialog(); > > > > sub build_gui # Building the GUI > > { > > $WIN = new Win32::GUI::Window( > > -left => 200, -top => 200, -width => 300, -height => 300, > > -name => "WIN", > > -text => "Static-DC-Test", > > #-noflicker => 1, # Useless/worse result > > ); > > $WIN->Show(); > > $DC{'color'}{'white'} = [255,255,255]; > > $DC{'color'}{'red'} = [255,0,0]; > > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > > 3, ); > > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > > -width => 1, ); > > &repaint; > > $DC{'timer'} = $WIN ->AddTimer("timer", 100); > > } > > > > sub ::timer_Timer # Repaint DC with interval of 'timer' > > { &repaint; } > > > > sub WIN_Terminate { return -1; } > > > > sub repaint # Create/rebuild DC-Object > > { > > $DC{'dc'}{'object'} = $WIN -> GetDC; > > $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); > > $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); > > $DC{'dc'}{'object'} -> BeginPath(); > > $DC{'dc'}{'object'} -> MoveTo(10, 10); > > $DC{'dc'}{'object'} -> LineTo(280, 260); > > $DC{'dc'}{'object'} -> EndPath(); > > $DC{'dc'}{'object'} -> StrokePath(); > > #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? > > } > > ------------------------------------- > > But the result of the code above is a flickering, annoying graphic. > > So the next thought, was to generate a bitmap from the DC. There is, if > > Im > > not wrong, a method with DIBitmap. But, I would like to refrain from > > binding > > in that module, only for converting a single graphic, because its > > bloating > > up the program/PAR-binary. > > > > > > Sadly, the DC-Documentation is frequent a sealed book for me. > > Does anyone know an easy method (I also like to take a complex solution > > :-)) > > to convert a DC into a bitmap-object, without using DIBitmap? Or, even > > better, a way to prevent that flickering during the repaint? > > > > Thanks a lot. > > > > Regards, > > Raphael > > > > > > > ---------------------------------------------------------------------------- > -- > > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > > CA > > -OSBC tackles the biggest issue in open source: Open Sourcing the > > Enterprise > > -Strategies to boost innovation and cut costs with open source > > participation > > -Receive a $600 discount off the registration fee with the source code: > > SFAD > > http://p.sf.net/sfu/XcvMzF8H > > _______________________________________________ > > Perl-Win32-GUI-Users mailing list > > Per...@li... > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > http://perl-win32-gui.sourceforge.net/ > > > > > > -- > View this message in context: > http://www.nabble.com/flickering-static-DC-tp22404906p22411762.html > Sent from the perl-win32-gui-users mailing list archive at Nabble.com. > > > ---------------------------------------------------------------------------- > -- > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > > ---------------------------------------------------------------------------- > -- > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > > ---------------------------------------------------------------------------- -- > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ ________________________________________ Windows Live just got better. Find out more! |
From: Sean H. <jal...@ho...> - 2009-03-13 19:13:34
|
I've been looking at the Makefile.PL to try and figure out how it works (because I'm creating my own extension). But I can't figure out how it knows to build the subpackages (AxWindow, BitmapInline, Scintilla, etc.), and how it knows which ones should have their code included in GUI.dll and which ones get their own DLL. Is MakeMaker just looking in all the subdirectories to see which ones have XS files and which ones have their own Makefile.PL? |
From: Jeremy W. <jez...@ho...> - 2009-03-13 19:08:01
|
Hi, It's not a Win32-GUI problem either - it's a windows thing. When a window is resized windows clears the area *before* the paint event is fired, resulting in that flash/flicker. You can work around this by associating a class to the window (which, I think, from memory stops the event that clears the window): my $WC = new Win32::GUI::Class( -name => "test", -style => 0, ); then: $WIN = new Win32::GUI::Window( -left => 200, -top => 200, -width => 300, -height => 300, -name => "WIN", -text => "Static-DC-Test v3", -class => $WC, #-noflicker => 1, # Will not work with the Paint-event ); and that should stop the flicker. I didn't test the above, but it should work:) Cheers, Jeremy. > From: win...@ra... > To: per...@li... > Date: Fri, 13 Mar 2009 13:33:05 +0100 > Subject: [perl-win32-gui-users] WG: flickering static-DC > > Hi @ all > > Here is a sample-programm for displaying a static DC over a memory-DC. > The sample is adapted from 'Region.pl'. > Flickering while moving the window, or moving an other window over the DC is > gone. Only while resizing the window, flickering appears. I think that is > not a DC-problem, but a win32-gui-problem > > ----------------- > # proper displaying and refreshing of a static DC > # Please see the demo 'Region.pl' for further explanations > use strict; > use Win32::GUI(); > our $WIN; > our %DC; > our @DATA; # Sample Data for the graph > > $DATA[0] = {'x' => 10, 'y' => 100}; > $DATA[1] = {'x' => 50, 'y' => 30}; > $DATA[2] = {'x' => 90, 'y' => 200}; > $DATA[3] = {'x' => 130, 'y' => 180}; > $DATA[4] = {'x' => 170, 'y' => 210}; > $DATA[5] = {'x' => 210, 'y' => 150}; > > &build_gui; # Inizialize program > Win32::GUI::Dialog(); > > sub build_gui # Building the GUI > { > $WIN = new Win32::GUI::Window( > -left => 200, -top => 200, -width => 300, -height => 300, > -name => "WIN", > -text => "Static-DC-Test v3", > #-noflicker => 1, # Will not work with the Paint-event > ); > $WIN->Show(); > # Defining the DC-styles > $DC{'color'}{'white'} = [255,255,255]; > $DC{'color'}{'red'} = [255,0,0]; > $DC{'color'}{'grey'} = [100,100,100]; > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > 3, ); > $DC{'grid'} = new Win32::GUI::Pen( -color => $DC{'color'}{'grey'}, -width => > 1, ); > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > -width => 1, ); > &repaint; # Generate the DC (first time) > } > > sub WIN_Terminate { return -1; } > > sub WIN_Paint # re-/paint-event of the window > { &repaint; } > > sub repaint # Create/rebuild DC-Object > { > # preparing the DC (memory-DC) > $DC{'dc'}{'object'} = $WIN -> GetDC; # Creating DC > $DC{'dc'}{'mem_object'} = $DC{'dc'}{'object'} -> CreateCompatibleDC(); # > Creating compatible DC > $DC{'dc'}{'bitmap'} = $DC{'dc'}{'object'} -> > CreateCompatibleBitmap(250,250); # Creating compatible Bitmap > $DC{'dc'}{'old_bitmap'} = $DC{'dc'}{'mem_object'} -> > SelectObject($DC{'dc'}{'bitmap'}); # Selecting the bitmap into the new DC > > # Drawing into the memory-DC > $DC{'dc'}{'mem_object'} -> FillRect(10, 10, 260, 260,$DC{'brush'}); > $DC{'dc'}{'mem_object'} -> SelectObject($DC{'grid'}); > for (my $i = 10;$i < 270; $i+=24) # Create y-grid > {$DC{'dc'}{'mem_object'} -> Line(10,$i,250,$i);} > for (my $i = 10;$i < 280; $i+=24) # Create x-grid > {$DC{'dc'}{'mem_object'} -> Line($i,10,$i,260);} > > $DC{'dc'}{'mem_object'} -> SelectObject($DC{'pen'}); > $DC{'dc'}{'mem_object'} -> BeginPath(); > $DC{'dc'}{'mem_object'} -> MoveTo($DATA[0]{'x'}, $DATA[0]{'y'}); # Create > graph (first point) > for (my $i = 1;$i < scalar @DATA;$i++) > { $DC{'dc'}{'mem_object'} -> LineTo($DATA[$i]{'x'}, $DATA[$i]{'y'}); } # > Steps > $DC{'dc'}{'mem_object'} -> EndPath(); > $DC{'dc'}{'mem_object'} -> StrokePath(); > > $DC{'dc'}{'object'} -> BitBlt(10, 10, 250,250,$DC{'dc'}{'mem_object'}, 10, > 10); # Updating the screen > $DC{'dc'}{'mem_object'} -> SelectObject($DC{'dc'}{'old_bitmap'}); # > Restoring original bitmap > $DC{'dc'}{'mem_object'} -> DeleteDC(); # Removing the memory-DC > } > ----------------- > Hope, the mail-linebreaks don't messing up the code > > Greetings, > Raphael > > -----Ursprüngliche Nachricht----- > Von: Raphael Stoeckli [mailto:win32gui@....ch] > Gesendet: Mittwoch, 11. März 2009 00:53 > An: 'zak3' > Cc: per...@li... > Betreff: Re: [perl-win32-gui-users] flickering static-DC > > Hi Zak > > I run probably an old version of ASPerl (5.8.6.811). There is an error, when > I try to run test8.pl or test13.pl. Hook ‘Perl_newXS_flags’ was not found in > perl58.dll. I think, I remained on 5.8.6.811, because of some > PAR-compatibility-issues (most likely obsolote now). I will try it on an > other machine with 5.8.8 or 5.10 the next days. > My program works now pretty good, without much flickering, only with > win32-GUI-corefunctions. I will also try to move my window-DC into a > memory-DC the next days, as I said in my last post. I will post some > sample-code when I finished that. > To tell the truth, DIBitmap and GD frighten me a little bit. Is not that I > don't understand it – already worked with DIBitmap intensively. But my > program will be a standalone-binary for PCs without Perl. Even though > 1TB-HDDs are on the advance, I am still skeptic if I have a binary of more > than 3 or 4 MB in front of me, to run a really simple program. Maybe I am > too conservative :-) > > Anyhow, much thanks for your hint. I will also study the two posts from > mail-archive.com. > > Greetings, > Raphael > > -----Ursprüngliche Nachricht----- > Von: zak3 [mailto:zak31415@.....com] > Gesendet: Montag, 9. März 2009 12:57 > An: per...@li... > Betreff: Re: [perl-win32-gui-users] flickering static-DC > > > Hi > also look to this link about drawing and refreshing: > http://www.nabble.com/Draw-on-click-and-refresh-the-window---resolved-td1809 > 3899.html > and the two tutorials by rob may about drawing and refreshing: > http://www.mail-archive.com/per...@li.../msg05 > 194.html > http://www.mail-archive.com/per...@li.../msg05 > 195.html > > also before three days i have found an example in the win32gui demos : > demos\DIBitmap\ the first is test8.pl and test13.pl they draw a circle > without any flickering, they use GD graphics with DIBitmap, first install GD > Graphics from this site:http://www.bribes.org/perl/ppmdir.html > using the command: > ppm install http://www.bribes.org/perl/ppm/GD.ppd > and try the test8.pl and test13.pl, the GD graphics have many plotting > statements for drawing lines, polygons, points, etc > > > Raphael Stoeckli wrote: > > > > Hi @ all > > > > I try to plot a static DC-Object (means: the graphic is calculated > > uniquely > > at runtime, depending of several parameters, and does not change while > > displaying the window) in a window. > > The problem is that this object continuously needs to be redrawn, because > > it > > vanishes during moving the window around, or if an other window is moving > > over it. > > I thought, a repaint-routine like that would solve the problem: > > ------------------------------------- > > use strict; > > use Win32::GUI(); > > our $WIN; > > our %DC; > > > > &build_gui; > > Win32::GUI::Dialog(); > > > > sub build_gui # Building the GUI > > { > > $WIN = new Win32::GUI::Window( > > -left => 200, -top => 200, -width => 300, -height => 300, > > -name => "WIN", > > -text => "Static-DC-Test", > > #-noflicker => 1, # Useless/worse result > > ); > > $WIN->Show(); > > $DC{'color'}{'white'} = [255,255,255]; > > $DC{'color'}{'red'} = [255,0,0]; > > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > > 3, ); > > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > > -width => 1, ); > > &repaint; > > $DC{'timer'} = $WIN ->AddTimer("timer", 100); > > } > > > > sub ::timer_Timer # Repaint DC with interval of 'timer' > > { &repaint; } > > > > sub WIN_Terminate { return -1; } > > > > sub repaint # Create/rebuild DC-Object > > { > > $DC{'dc'}{'object'} = $WIN -> GetDC; > > $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); > > $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); > > $DC{'dc'}{'object'} -> BeginPath(); > > $DC{'dc'}{'object'} -> MoveTo(10, 10); > > $DC{'dc'}{'object'} -> LineTo(280, 260); > > $DC{'dc'}{'object'} -> EndPath(); > > $DC{'dc'}{'object'} -> StrokePath(); > > #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? > > } > > ------------------------------------- > > But the result of the code above is a flickering, annoying graphic. > > So the next thought, was to generate a bitmap from the DC. There is, if > > I’m > > not wrong, a method with DIBitmap. But, I would like to refrain from > > binding > > in that module, only for converting a single graphic, because it’s > > bloating > > up the program/PAR-binary. > > > > > > Sadly, the DC-Documentation is frequent a sealed book for me. > > Does anyone know an easy method (I also like to take a complex solution > > :-)) > > to convert a DC into a bitmap-object, without using DIBitmap? Or, even > > better, a way to prevent that flickering during the repaint? > > > > Thanks a lot. > > > > Regards, > > Raphael > > > > > > > ---------------------------------------------------------------------------- > -- > > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > > CA > > -OSBC tackles the biggest issue in open source: Open Sourcing the > > Enterprise > > -Strategies to boost innovation and cut costs with open source > > participation > > -Receive a $600 discount off the registration fee with the source code: > > SFAD > > http://p.sf.net/sfu/XcvMzF8H > > _______________________________________________ > > Perl-Win32-GUI-Users mailing list > > Per...@li... > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > http://perl-win32-gui.sourceforge.net/ > > > > > > -- > View this message in context: > http://www.nabble.com/flickering-static-DC-tp22404906p22411762.html > Sent from the perl-win32-gui-users mailing list archive at Nabble.com. > > > ---------------------------------------------------------------------------- > -- > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > > ---------------------------------------------------------------------------- > -- > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ _________________________________________________________________ All your Twitter and other social updates in one place http://clk.atdmt.com/UKM/go/137984870/direct/01/ |
From: Raphael S. <win...@ra...> - 2009-03-13 12:31:13
|
Hi @ all Here is a sample-programm for displaying a static DC over a memory-DC. The sample is adapted from 'Region.pl'. Flickering while moving the window, or moving an other window over the DC is gone. Only while resizing the window, flickering appears. I think that is not a DC-problem, but a win32-gui-problem ----------------- # proper displaying and refreshing of a static DC # Please see the demo 'Region.pl' for further explanations use strict; use Win32::GUI(); our $WIN; our %DC; our @DATA; # Sample Data for the graph $DATA[0] = {'x' => 10, 'y' => 100}; $DATA[1] = {'x' => 50, 'y' => 30}; $DATA[2] = {'x' => 90, 'y' => 200}; $DATA[3] = {'x' => 130, 'y' => 180}; $DATA[4] = {'x' => 170, 'y' => 210}; $DATA[5] = {'x' => 210, 'y' => 150}; &build_gui; # Inizialize program Win32::GUI::Dialog(); sub build_gui # Building the GUI { $WIN = new Win32::GUI::Window( -left => 200, -top => 200, -width => 300, -height => 300, -name => "WIN", -text => "Static-DC-Test v3", #-noflicker => 1, # Will not work with the Paint-event ); $WIN->Show(); # Defining the DC-styles $DC{'color'}{'white'} = [255,255,255]; $DC{'color'}{'red'} = [255,0,0]; $DC{'color'}{'grey'} = [100,100,100]; $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => 3, ); $DC{'grid'} = new Win32::GUI::Pen( -color => $DC{'color'}{'grey'}, -width => 1, ); $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, -width => 1, ); &repaint; # Generate the DC (first time) } sub WIN_Terminate { return -1; } sub WIN_Paint # re-/paint-event of the window { &repaint; } sub repaint # Create/rebuild DC-Object { # preparing the DC (memory-DC) $DC{'dc'}{'object'} = $WIN -> GetDC; # Creating DC $DC{'dc'}{'mem_object'} = $DC{'dc'}{'object'} -> CreateCompatibleDC(); # Creating compatible DC $DC{'dc'}{'bitmap'} = $DC{'dc'}{'object'} -> CreateCompatibleBitmap(250,250); # Creating compatible Bitmap $DC{'dc'}{'old_bitmap'} = $DC{'dc'}{'mem_object'} -> SelectObject($DC{'dc'}{'bitmap'}); # Selecting the bitmap into the new DC # Drawing into the memory-DC $DC{'dc'}{'mem_object'} -> FillRect(10, 10, 260, 260,$DC{'brush'}); $DC{'dc'}{'mem_object'} -> SelectObject($DC{'grid'}); for (my $i = 10;$i < 270; $i+=24) # Create y-grid {$DC{'dc'}{'mem_object'} -> Line(10,$i,250,$i);} for (my $i = 10;$i < 280; $i+=24) # Create x-grid {$DC{'dc'}{'mem_object'} -> Line($i,10,$i,260);} $DC{'dc'}{'mem_object'} -> SelectObject($DC{'pen'}); $DC{'dc'}{'mem_object'} -> BeginPath(); $DC{'dc'}{'mem_object'} -> MoveTo($DATA[0]{'x'}, $DATA[0]{'y'}); # Create graph (first point) for (my $i = 1;$i < scalar @DATA;$i++) { $DC{'dc'}{'mem_object'} -> LineTo($DATA[$i]{'x'}, $DATA[$i]{'y'}); } # Steps $DC{'dc'}{'mem_object'} -> EndPath(); $DC{'dc'}{'mem_object'} -> StrokePath(); $DC{'dc'}{'object'} -> BitBlt(10, 10, 250,250,$DC{'dc'}{'mem_object'}, 10, 10); # Updating the screen $DC{'dc'}{'mem_object'} -> SelectObject($DC{'dc'}{'old_bitmap'}); # Restoring original bitmap $DC{'dc'}{'mem_object'} -> DeleteDC(); # Removing the memory-DC } ----------------- Hope, the mail-linebreaks don't messing up the code Greetings, Raphael -----Ursprüngliche Nachricht----- Von: Raphael Stoeckli [mailto:win32gui@....ch] Gesendet: Mittwoch, 11. März 2009 00:53 An: 'zak3' Cc: per...@li... Betreff: Re: [perl-win32-gui-users] flickering static-DC Hi Zak I run probably an old version of ASPerl (5.8.6.811). There is an error, when I try to run test8.pl or test13.pl. Hook Perl_newXS_flags was not found in perl58.dll. I think, I remained on 5.8.6.811, because of some PAR-compatibility-issues (most likely obsolote now). I will try it on an other machine with 5.8.8 or 5.10 the next days. My program works now pretty good, without much flickering, only with win32-GUI-corefunctions. I will also try to move my window-DC into a memory-DC the next days, as I said in my last post. I will post some sample-code when I finished that. To tell the truth, DIBitmap and GD frighten me a little bit. Is not that I don't understand it already worked with DIBitmap intensively. But my program will be a standalone-binary for PCs without Perl. Even though 1TB-HDDs are on the advance, I am still skeptic if I have a binary of more than 3 or 4 MB in front of me, to run a really simple program. Maybe I am too conservative :-) Anyhow, much thanks for your hint. I will also study the two posts from mail-archive.com. Greetings, Raphael -----Ursprüngliche Nachricht----- Von: zak3 [mailto:zak31415@.....com] Gesendet: Montag, 9. März 2009 12:57 An: per...@li... Betreff: Re: [perl-win32-gui-users] flickering static-DC Hi also look to this link about drawing and refreshing: http://www.nabble.com/Draw-on-click-and-refresh-the-window---resolved-td1809 3899.html and the two tutorials by rob may about drawing and refreshing: http://www.mail-archive.com/per...@li.../msg05 194.html http://www.mail-archive.com/per...@li.../msg05 195.html also before three days i have found an example in the win32gui demos : demos\DIBitmap\ the first is test8.pl and test13.pl they draw a circle without any flickering, they use GD graphics with DIBitmap, first install GD Graphics from this site:http://www.bribes.org/perl/ppmdir.html using the command: ppm install http://www.bribes.org/perl/ppm/GD.ppd and try the test8.pl and test13.pl, the GD graphics have many plotting statements for drawing lines, polygons, points, etc Raphael Stoeckli wrote: > > Hi @ all > > I try to plot a static DC-Object (means: the graphic is calculated > uniquely > at runtime, depending of several parameters, and does not change while > displaying the window) in a window. > The problem is that this object continuously needs to be redrawn, because > it > vanishes during moving the window around, or if an other window is moving > over it. > I thought, a repaint-routine like that would solve the problem: > ------------------------------------- > use strict; > use Win32::GUI(); > our $WIN; > our %DC; > > &build_gui; > Win32::GUI::Dialog(); > > sub build_gui # Building the GUI > { > $WIN = new Win32::GUI::Window( > -left => 200, -top => 200, -width => 300, -height => 300, > -name => "WIN", > -text => "Static-DC-Test", > #-noflicker => 1, # Useless/worse result > ); > $WIN->Show(); > $DC{'color'}{'white'} = [255,255,255]; > $DC{'color'}{'red'} = [255,0,0]; > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > 3, ); > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > -width => 1, ); > &repaint; > $DC{'timer'} = $WIN ->AddTimer("timer", 100); > } > > sub ::timer_Timer # Repaint DC with interval of 'timer' > { &repaint; } > > sub WIN_Terminate { return -1; } > > sub repaint # Create/rebuild DC-Object > { > $DC{'dc'}{'object'} = $WIN -> GetDC; > $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); > $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); > $DC{'dc'}{'object'} -> BeginPath(); > $DC{'dc'}{'object'} -> MoveTo(10, 10); > $DC{'dc'}{'object'} -> LineTo(280, 260); > $DC{'dc'}{'object'} -> EndPath(); > $DC{'dc'}{'object'} -> StrokePath(); > #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? > } > ------------------------------------- > But the result of the code above is a flickering, annoying graphic. > So the next thought, was to generate a bitmap from the DC. There is, if > Im > not wrong, a method with DIBitmap. But, I would like to refrain from > binding > in that module, only for converting a single graphic, because its > bloating > up the program/PAR-binary. > > > Sadly, the DC-Documentation is frequent a sealed book for me. > Does anyone know an easy method (I also like to take a complex solution > :-)) > to convert a DC into a bitmap-object, without using DIBitmap? Or, even > better, a way to prevent that flickering during the repaint? > > Thanks a lot. > > Regards, > Raphael > > > ---------------------------------------------------------------------------- -- > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > -- View this message in context: http://www.nabble.com/flickering-static-DC-tp22404906p22411762.html Sent from the perl-win32-gui-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/ ---------------------------------------------------------------------------- -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ 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: Jason P. <ma...@wa...> - 2009-03-11 02:30:12
|
Unfortunately, the standalone runtimes are 75% of that package, no matter which packager you use. Even though they really just zip up the files and then temporarily extract them and spit them through the runtime, you can only pack the xs so far. If someone packed perl into a .net clr it would work so much cleaner, but then the user would still need that runtime! On 3/10/09, Raphael Stoeckli <win...@ra...> wrote: > Hi Zak > > I run probably an old version of ASPerl (5.8.6.811). There is an error, when > I try to run test8.pl or test13.pl. Hook ‘Perl_newXS_flags’ was not found in > perl58.dll. I think, I remained on 5.8.6.811, because of some > PAR-compatibility-issues (most likely obsolote now). I will try it on an > other machine with 5.8.8 or 5.10 the next days. > My program works now pretty good, without much flickering, only with > win32-GUI-corefunctions. I will also try to move my window-DC into a > memory-DC the next days, as I said in my last post. I will post some > sample-code when I finished that. > To tell the truth, DIBitmap and GD frighten me a little bit. Is not that I > don't understand it – already worked with DIBitmap intensively. But my > program will be a standalone-binary for PCs without Perl. Even though > 1TB-HDDs are on the advance, I am still skeptic if I have a binary of more > than 3 or 4 MB in front of me, to run a really simple program. Maybe I am > too conservative :-) > > Anyhow, much thanks for your hint. I will also study the two posts from > mail-archive.com. > > Greetings, > Raphael > > -----Ursprüngliche Nachricht----- > Von: zak3 [mailto:zak31415@.....com] > Gesendet: Montag, 9. März 2009 12:57 > An: per...@li... > Betreff: Re: [perl-win32-gui-users] flickering static-DC > > > Hi > also look to this link about drawing and refreshing: > http://www.nabble.com/Draw-on-click-and-refresh-the-window---resolved-td1809 > 3899.html > and the two tutorials by rob may about drawing and refreshing: > http://www.mail-archive.com/per...@li.../msg05 > 194.html > http://www.mail-archive.com/per...@li.../msg05 > 195.html > > also before three days i have found an example in the win32gui demos : > demos\DIBitmap\ the first is test8.pl and test13.pl they draw a circle > without any flickering, they use GD graphics with DIBitmap, first install GD > Graphics from this site:http://www.bribes.org/perl/ppmdir.html > using the command: > ppm install http://www.bribes.org/perl/ppm/GD.ppd > and try the test8.pl and test13.pl, the GD graphics have many plotting > statements for drawing lines, polygons, points, etc > > > Raphael Stoeckli wrote: >> >> Hi @ all >> >> I try to plot a static DC-Object (means: the graphic is calculated >> uniquely >> at runtime, depending of several parameters, and does not change while >> displaying the window) in a window. >> The problem is that this object continuously needs to be redrawn, because >> it >> vanishes during moving the window around, or if an other window is moving >> over it. >> I thought, a repaint-routine like that would solve the problem: >> ------------------------------------- >> use strict; >> use Win32::GUI(); >> our $WIN; >> our %DC; >> >> &build_gui; >> Win32::GUI::Dialog(); >> >> sub build_gui # Building the GUI >> { >> $WIN = new Win32::GUI::Window( >> -left => 200, -top => 200, -width => 300, -height => 300, >> -name => "WIN", >> -text => "Static-DC-Test", >> #-noflicker => 1, # Useless/worse result >> ); >> $WIN->Show(); >> $DC{'color'}{'white'} = [255,255,255]; >> $DC{'color'}{'red'} = [255,0,0]; >> $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => >> 3, ); >> $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, >> -width => 1, ); >> &repaint; >> $DC{'timer'} = $WIN ->AddTimer("timer", 100); >> } >> >> sub ::timer_Timer # Repaint DC with interval of 'timer' >> { &repaint; } >> >> sub WIN_Terminate { return -1; } >> >> sub repaint # Create/rebuild DC-Object >> { >> $DC{'dc'}{'object'} = $WIN -> GetDC; >> $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); >> $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); >> $DC{'dc'}{'object'} -> BeginPath(); >> $DC{'dc'}{'object'} -> MoveTo(10, 10); >> $DC{'dc'}{'object'} -> LineTo(280, 260); >> $DC{'dc'}{'object'} -> EndPath(); >> $DC{'dc'}{'object'} -> StrokePath(); >> #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? >> } >> ------------------------------------- >> But the result of the code above is a flickering, annoying graphic. >> So the next thought, was to generate a bitmap from the DC. There is, if >> I’m >> not wrong, a method with DIBitmap. But, I would like to refrain from >> binding >> in that module, only for converting a single graphic, because it’s >> bloating >> up the program/PAR-binary. >> >> >> Sadly, the DC-Documentation is frequent a sealed book for me. >> Does anyone know an easy method (I also like to take a complex solution >> :-)) >> to convert a DC into a bitmap-object, without using DIBitmap? Or, even >> better, a way to prevent that flickering during the repaint? >> >> Thanks a lot. >> >> Regards, >> Raphael >> >> >> > ---------------------------------------------------------------------------- > -- >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >> CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source code: >> SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> Perl-Win32-GUI-Users mailing list >> Per...@li... >> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users >> http://perl-win32-gui.sourceforge.net/ >> >> > > -- > View this message in context: > http://www.nabble.com/flickering-static-DC-tp22404906p22411762.html > Sent from the perl-win32-gui-users mailing list archive at Nabble.com. > > > ---------------------------------------------------------------------------- > -- > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > -- Sent from my mobile device Maximus* WarheadsSE MaxSource |
From: Raphael S. <win...@ra...> - 2009-03-10 23:51:38
|
Hi Zak I run probably an old version of ASPerl (5.8.6.811). There is an error, when I try to run test8.pl or test13.pl. Hook Perl_newXS_flags was not found in perl58.dll. I think, I remained on 5.8.6.811, because of some PAR-compatibility-issues (most likely obsolote now). I will try it on an other machine with 5.8.8 or 5.10 the next days. My program works now pretty good, without much flickering, only with win32-GUI-corefunctions. I will also try to move my window-DC into a memory-DC the next days, as I said in my last post. I will post some sample-code when I finished that. To tell the truth, DIBitmap and GD frighten me a little bit. Is not that I don't understand it already worked with DIBitmap intensively. But my program will be a standalone-binary for PCs without Perl. Even though 1TB-HDDs are on the advance, I am still skeptic if I have a binary of more than 3 or 4 MB in front of me, to run a really simple program. Maybe I am too conservative :-) Anyhow, much thanks for your hint. I will also study the two posts from mail-archive.com. Greetings, Raphael -----Ursprüngliche Nachricht----- Von: zak3 [mailto:zak31415@.....com] Gesendet: Montag, 9. März 2009 12:57 An: per...@li... Betreff: Re: [perl-win32-gui-users] flickering static-DC Hi also look to this link about drawing and refreshing: http://www.nabble.com/Draw-on-click-and-refresh-the-window---resolved-td1809 3899.html and the two tutorials by rob may about drawing and refreshing: http://www.mail-archive.com/per...@li.../msg05 194.html http://www.mail-archive.com/per...@li.../msg05 195.html also before three days i have found an example in the win32gui demos : demos\DIBitmap\ the first is test8.pl and test13.pl they draw a circle without any flickering, they use GD graphics with DIBitmap, first install GD Graphics from this site:http://www.bribes.org/perl/ppmdir.html using the command: ppm install http://www.bribes.org/perl/ppm/GD.ppd and try the test8.pl and test13.pl, the GD graphics have many plotting statements for drawing lines, polygons, points, etc Raphael Stoeckli wrote: > > Hi @ all > > I try to plot a static DC-Object (means: the graphic is calculated > uniquely > at runtime, depending of several parameters, and does not change while > displaying the window) in a window. > The problem is that this object continuously needs to be redrawn, because > it > vanishes during moving the window around, or if an other window is moving > over it. > I thought, a repaint-routine like that would solve the problem: > ------------------------------------- > use strict; > use Win32::GUI(); > our $WIN; > our %DC; > > &build_gui; > Win32::GUI::Dialog(); > > sub build_gui # Building the GUI > { > $WIN = new Win32::GUI::Window( > -left => 200, -top => 200, -width => 300, -height => 300, > -name => "WIN", > -text => "Static-DC-Test", > #-noflicker => 1, # Useless/worse result > ); > $WIN->Show(); > $DC{'color'}{'white'} = [255,255,255]; > $DC{'color'}{'red'} = [255,0,0]; > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > 3, ); > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > -width => 1, ); > &repaint; > $DC{'timer'} = $WIN ->AddTimer("timer", 100); > } > > sub ::timer_Timer # Repaint DC with interval of 'timer' > { &repaint; } > > sub WIN_Terminate { return -1; } > > sub repaint # Create/rebuild DC-Object > { > $DC{'dc'}{'object'} = $WIN -> GetDC; > $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); > $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); > $DC{'dc'}{'object'} -> BeginPath(); > $DC{'dc'}{'object'} -> MoveTo(10, 10); > $DC{'dc'}{'object'} -> LineTo(280, 260); > $DC{'dc'}{'object'} -> EndPath(); > $DC{'dc'}{'object'} -> StrokePath(); > #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? > } > ------------------------------------- > But the result of the code above is a flickering, annoying graphic. > So the next thought, was to generate a bitmap from the DC. There is, if > Im > not wrong, a method with DIBitmap. But, I would like to refrain from > binding > in that module, only for converting a single graphic, because its > bloating > up the program/PAR-binary. > > > Sadly, the DC-Documentation is frequent a sealed book for me. > Does anyone know an easy method (I also like to take a complex solution > :-)) > to convert a DC into a bitmap-object, without using DIBitmap? Or, even > better, a way to prevent that flickering during the repaint? > > Thanks a lot. > > Regards, > Raphael > > > ---------------------------------------------------------------------------- -- > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > -- View this message in context: http://www.nabble.com/flickering-static-DC-tp22404906p22411762.html Sent from the perl-win32-gui-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- _______________________________________________ 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: Raphael S. <win...@ra...> - 2009-03-09 20:51:02
|
Hi Jeremy I noticed that with Validate() in the meanwhile. The flickering came back as I added more DC-elements. A terminating $DC{'dc'}{'object'} -> Validate(); # (Uncommented this at line 43 of the example) stopped further flickering, respectively endless repaint. My example was probably a little bit too simple. Big question mark is still that: WIN_Paint { my $dc = shift; # <-- ??? } I don't need that. Is my code working without an assigned parameter, because my DC-Object is global? The Validate() happens in my example-sub repaint{}. But it's probably the wrong approach (see section below). As to the performance: As you said, in the examples BitmapScroll.pl and Region.pl is BitBlt used. I will look into them. Well, thanks for this hint. Concerning to function describing, the DC-documentation is, let me say a little bit minimalist. Thanks a lot. Greetings, Raphael ________________________________________ Von: Jeremy White [mailto:jez_white@.....com] Gesendet: Montag, 9. März 2009 19:39 An: win32gui@.....ch; max@.....net Cc: per...@li... Betreff: RE: [perl-win32-gui-users] flickering static-DC Hi Raphael, I don't have Win32::GUI in front of me - but: You always need Validate, as this tells windows that you have finished drawing for the paint event. Drawing to a "live" DC will always be slow and flickery. You need to draw to a memory DC and bitblit the result to the window DC - I think there is an example of this in the examples that comes with Win32::GUI. Cheers, Jeremy. > From: win32gui@.....ch > To: ma...@wa... > Date: Mon, 9 Mar 2009 12:22:02 +0100 > CC: per...@li... > Subject: Re: [perl-win32-gui-users] flickering static-DC > > Hi Jason > > Thanks for the fast response. > Serendipitously I found a usable solution for the problem, just some minutes > ago. > There is a window-event called Paint, with the mysterious description "Sent > when the window needs to be repainted." > Here is the updated code: > > ------------------------------------- > use strict; > use Win32::GUI(); > our $WIN; > our %DC; > > &build_gui; > Win32::GUI::Dialog(); > > sub build_gui # Building the GUI > { > $WIN = new Win32::GUI::Window( > -left => 200, -top => 200, -width => 300, -height => 300, > -name => "WIN", > -text => "Static-DC-Test v2", > #-noflicker => 1, # Will not work with the Paint-event > ); > $WIN->Show(); > $DC{'color'}{'white'} = [255,255,255]; > $DC{'color'}{'red'} = [255,0,0]; > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > 3, ); > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > -width => 1, ); > &repaint; > } > > sub WIN_Terminate { return -1; } > > sub WIN_Paint # re-/paint-event of the window > { > #my $DC = shift; # seems to be no need for this (in that case?) > &repaint; > } > > sub repaint # Create/rebuild DC-Object > { > $DC{'dc'}{'object'} = $WIN -> GetDC; > $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); > $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); > $DC{'dc'}{'object'} -> BeginPath(); > $DC{'dc'}{'object'} -> MoveTo(10, 10); > $DC{'dc'}{'object'} -> LineTo(280, 260); > $DC{'dc'}{'object'} -> EndPath(); > $DC{'dc'}{'object'} -> StrokePath(); > # $DC{'dc'}{'object'} -> Validate(); # seems to be no need for this (in that > case?) > } > ------------------------------------- > > Flickering is reduced to the times, when an other window moves over the > DC-window, (or the DC-window is resizing). But in my case that's not very > annoying. What I'm not getting at the moment is the thing with Validate() of > the DC (seems nothing to do), or if there is a more efficient way to draw > the DC. > > Nevertheless I hope, I can help other people with the example above. > > Greetings, > Raphael > > ________________________________________ > Von: Jason Plum [mailto:max@.....net] > Gesendet: Montag, 9. März 2009 10:02 > An: Raphael Stoeckli > Cc: per...@li... > Betreff: Re: [perl-win32-gui-users] flickering static-DC > > Hello Raphael, > > I unfortunately do not have a breadth of experience with the DC object as > some on this list, but having seen this I can at least offer some tid-bit of > possible use. I would say that the one means I can come to think of is > ignoring repaint wherein there is no cause to redraw this particular > rectangle. Ok, this sounds a simple concept, but I realize this may not be > as easy to complete in reality. This of course, offers no help with the > issue of the bad flicker during dragging, but it offers some to the regular > usage flickering. > > > Jason P > On Sun, Mar 8, 2009 at 7:54 PM, Raphael Stoeckli <win32gui@.....ch> wrote: > Hi @ all > > I try to plot a static DC-Object (means: the graphic is calculated uniquely > at runtime, depending of several parameters, and does not change while > displaying the window) in a window. > The problem is that this object continuously needs to be redrawn, because it > vanishes during moving the window around, or if an other window is moving > over it. > I thought, a repaint-routine like that would solve the problem: > ------------------------------------- > use strict; > use Win32::GUI(); > our $WIN; > our %DC; > > &build_gui; > Win32::GUI::Dialog(); > > sub build_gui # Building the GUI > { > $WIN = new Win32::GUI::Window( > -left => 200, -top => 200, -width => 300, -height => 300, > -name => "WIN", > -text => "Static-DC-Test", > #-noflicker => 1, # Useless/worse result > ); > $WIN->Show(); > $DC{'color'}{'white'} = [255,255,255]; > $DC{'color'}{'red'} = [255,0,0]; > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > 3, ); > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > -width => 1, ); > &repaint; > $DC{'timer'} = $WIN ->AddTimer("timer", 100); > } > > sub ::timer_Timer # Repaint DC with interval of 'timer' > { &repaint; } > > sub WIN_Terminate { return -1; } > > sub repaint # Create/rebuild DC-Object > { > $DC{'dc'}{'object'} = $WIN -> GetDC; > $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); > $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); > $DC{'dc'}{'object'} -> BeginPath(); > $DC{'dc'}{'object'} -> MoveTo(10, 10); > $DC{'dc'}{'object'} -> LineTo(280, 260); > $DC{'dc'}{'object'} -> EndPath(); > $DC{'dc'}{'object'} -> StrokePath(); > #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? > } > ------------------------------------- > But the result of the code above is a flickering, annoying graphic. > So the next thought, was to generate a bitmap from the DC. There is, if Im > not wrong, a method with DIBitmap. But, I would like to refrain from binding > in that module, only for converting a single graphic, because its bloating > up the program/PAR-binary. > > > Sadly, the DC-Documentation is frequent a sealed book for me. > Does anyone know an easy method (I also like to take a complex solution :-)) > to convert a DC into a bitmap-object, without using DIBitmap? Or, even > better, a way to prevent that flickering during the repaint? > > Thanks a lot. > > Regards, > Raphael > > > ---------------------------------------------------------------------------- > -- > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > > > -- > Maximus* > WarheadsSE > MaxSource > > > ---------------------------------------------------------------------------- -- > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ ________________________________________ Share your photos with Windows Live Photos Free. Try it Now! |
From: Jeremy W. <jez...@ho...> - 2009-03-09 18:39:40
|
Hi Raphael, I don't have Win32::GUI in front of me - but: You always need Validate, as this tells windows that you have finished drawing for the paint event. Drawing to a "live" DC will always be slow and flickery. You need to draw to a memory DC and bitblit the result to the window DC - I think there is an example of this in the examples that comes with Win32::GUI. Cheers, Jeremy. > From: win...@ra... > To: ma...@wa... > Date: Mon, 9 Mar 2009 12:22:02 +0100 > CC: per...@li... > Subject: Re: [perl-win32-gui-users] flickering static-DC > > Hi Jason > > Thanks for the fast response. > Serendipitously I found a usable solution for the problem, just some minutes > ago. > There is a window-event called Paint, with the mysterious description "Sent > when the window needs to be repainted." > Here is the updated code: > > ------------------------------------- > use strict; > use Win32::GUI(); > our $WIN; > our %DC; > > &build_gui; > Win32::GUI::Dialog(); > > sub build_gui # Building the GUI > { > $WIN = new Win32::GUI::Window( > -left => 200, -top => 200, -width => 300, -height => 300, > -name => "WIN", > -text => "Static-DC-Test v2", > #-noflicker => 1, # Will not work with the Paint-event > ); > $WIN->Show(); > $DC{'color'}{'white'} = [255,255,255]; > $DC{'color'}{'red'} = [255,0,0]; > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > 3, ); > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > -width => 1, ); > &repaint; > } > > sub WIN_Terminate { return -1; } > > sub WIN_Paint # re-/paint-event of the window > { > #my $DC = shift; # seems to be no need for this (in that case?) > &repaint; > } > > sub repaint # Create/rebuild DC-Object > { > $DC{'dc'}{'object'} = $WIN -> GetDC; > $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); > $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); > $DC{'dc'}{'object'} -> BeginPath(); > $DC{'dc'}{'object'} -> MoveTo(10, 10); > $DC{'dc'}{'object'} -> LineTo(280, 260); > $DC{'dc'}{'object'} -> EndPath(); > $DC{'dc'}{'object'} -> StrokePath(); > # $DC{'dc'}{'object'} -> Validate(); # seems to be no need for this (in that > case?) > } > ------------------------------------- > > Flickering is reduced to the times, when an other window moves over the > DC-window, (or the DC-window is resizing). But in my case that's not very > annoying. What I'm not getting at the moment is the thing with Validate() of > the DC (seems nothing to do), or if there is a more efficient way to draw > the DC. > > Nevertheless I hope, I can help other people with the example above. > > Greetings, > Raphael > > ________________________________________ > Von: Jason Plum [mailto:max@.....net] > Gesendet: Montag, 9. März 2009 10:02 > An: Raphael Stoeckli > Cc: per...@li... > Betreff: Re: [perl-win32-gui-users] flickering static-DC > > Hello Raphael, > > I unfortunately do not have a breadth of experience with the DC object as > some on this list, but having seen this I can at least offer some tid-bit of > possible use. I would say that the one means I can come to think of is > ignoring repaint wherein there is no cause to redraw this particular > rectangle. Ok, this sounds a simple concept, but I realize this may not be > as easy to complete in reality. This of course, offers no help with the > issue of the bad flicker during dragging, but it offers some to the regular > usage flickering. > > > Jason P > On Sun, Mar 8, 2009 at 7:54 PM, Raphael Stoeckli <win32gui@.....ch> wrote: > Hi @ all > > I try to plot a static DC-Object (means: the graphic is calculated uniquely > at runtime, depending of several parameters, and does not change while > displaying the window) in a window. > The problem is that this object continuously needs to be redrawn, because it > vanishes during moving the window around, or if an other window is moving > over it. > I thought, a repaint-routine like that would solve the problem: > ------------------------------------- > use strict; > use Win32::GUI(); > our $WIN; > our %DC; > > &build_gui; > Win32::GUI::Dialog(); > > sub build_gui # Building the GUI > { > $WIN = new Win32::GUI::Window( > -left => 200, -top => 200, -width => 300, -height => 300, > -name => "WIN", > -text => "Static-DC-Test", > #-noflicker => 1, # Useless/worse result > ); > $WIN->Show(); > $DC{'color'}{'white'} = [255,255,255]; > $DC{'color'}{'red'} = [255,0,0]; > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > 3, ); > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > -width => 1, ); > &repaint; > $DC{'timer'} = $WIN ->AddTimer("timer", 100); > } > > sub ::timer_Timer # Repaint DC with interval of 'timer' > { &repaint; } > > sub WIN_Terminate { return -1; } > > sub repaint # Create/rebuild DC-Object > { > $DC{'dc'}{'object'} = $WIN -> GetDC; > $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); > $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); > $DC{'dc'}{'object'} -> BeginPath(); > $DC{'dc'}{'object'} -> MoveTo(10, 10); > $DC{'dc'}{'object'} -> LineTo(280, 260); > $DC{'dc'}{'object'} -> EndPath(); > $DC{'dc'}{'object'} -> StrokePath(); > #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? > } > ------------------------------------- > But the result of the code above is a flickering, annoying graphic. > So the next thought, was to generate a bitmap from the DC. There is, if I’m > not wrong, a method with DIBitmap. But, I would like to refrain from binding > in that module, only for converting a single graphic, because it’s bloating > up the program/PAR-binary. > > > Sadly, the DC-Documentation is frequent a sealed book for me. > Does anyone know an easy method (I also like to take a complex solution :-)) > to convert a DC into a bitmap-object, without using DIBitmap? Or, even > better, a way to prevent that flickering during the repaint? > > Thanks a lot. > > Regards, > Raphael > > > ---------------------------------------------------------------------------- > -- > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > > > -- > Maximus* > WarheadsSE > MaxSource > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ _________________________________________________________________ 25GB of FREE Online Storage – Find out more http://clk.atdmt.com/UKM/go/134665320/direct/01/ |
From: zak3 <zak...@gm...> - 2009-03-09 11:57:04
|
Hi also look to this link about drawing and refreshing: http://www.nabble.com/Draw-on-click-and-refresh-the-window---resolved-td18093899.html and the two tutorials by rob may about drawing and refreshing: http://www.mail-archive.com/per...@li.../msg05194.html http://www.mail-archive.com/per...@li.../msg05195.html also before three days i have found an example in the win32gui demos : demos\DIBitmap\ the first is test8.pl and test13.pl they draw a circle without any flickering, they use GD graphics with DIBitmap, first install GD Graphics from this site:http://www.bribes.org/perl/ppmdir.html using the command: ppm install http://www.bribes.org/perl/ppm/GD.ppd and try the test8.pl and test13.pl, the GD graphics have many plotting statements for drawing lines, polygons, points, etc Raphael Stoeckli wrote: > > Hi @ all > > I try to plot a static DC-Object (means: the graphic is calculated > uniquely > at runtime, depending of several parameters, and does not change while > displaying the window) in a window. > The problem is that this object continuously needs to be redrawn, because > it > vanishes during moving the window around, or if an other window is moving > over it. > I thought, a repaint-routine like that would solve the problem: > ------------------------------------- > use strict; > use Win32::GUI(); > our $WIN; > our %DC; > > &build_gui; > Win32::GUI::Dialog(); > > sub build_gui # Building the GUI > { > $WIN = new Win32::GUI::Window( > -left => 200, -top => 200, -width => 300, -height => 300, > -name => "WIN", > -text => "Static-DC-Test", > #-noflicker => 1, # Useless/worse result > ); > $WIN->Show(); > $DC{'color'}{'white'} = [255,255,255]; > $DC{'color'}{'red'} = [255,0,0]; > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > 3, ); > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > -width => 1, ); > &repaint; > $DC{'timer'} = $WIN ->AddTimer("timer", 100); > } > > sub ::timer_Timer # Repaint DC with interval of 'timer' > { &repaint; } > > sub WIN_Terminate { return -1; } > > sub repaint # Create/rebuild DC-Object > { > $DC{'dc'}{'object'} = $WIN -> GetDC; > $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); > $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); > $DC{'dc'}{'object'} -> BeginPath(); > $DC{'dc'}{'object'} -> MoveTo(10, 10); > $DC{'dc'}{'object'} -> LineTo(280, 260); > $DC{'dc'}{'object'} -> EndPath(); > $DC{'dc'}{'object'} -> StrokePath(); > #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? > } > ------------------------------------- > But the result of the code above is a flickering, annoying graphic. > So the next thought, was to generate a bitmap from the DC. There is, if > Im > not wrong, a method with DIBitmap. But, I would like to refrain from > binding > in that module, only for converting a single graphic, because its > bloating > up the program/PAR-binary. > > > Sadly, the DC-Documentation is frequent a sealed book for me. > Does anyone know an easy method (I also like to take a complex solution > :-)) > to convert a DC into a bitmap-object, without using DIBitmap? Or, even > better, a way to prevent that flickering during the repaint? > > Thanks a lot. > > Regards, > Raphael > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > -- View this message in context: http://www.nabble.com/flickering-static-DC-tp22404906p22411762.html Sent from the perl-win32-gui-users mailing list archive at Nabble.com. |
From: Raphael S. <win...@ra...> - 2009-03-09 11:20:15
|
Hi Jason Thanks for the fast response. Serendipitously I found a usable solution for the problem, just some minutes ago. There is a window-event called Paint, with the mysterious description "Sent when the window needs to be repainted." Here is the updated code: ------------------------------------- use strict; use Win32::GUI(); our $WIN; our %DC; &build_gui; Win32::GUI::Dialog(); sub build_gui # Building the GUI { $WIN = new Win32::GUI::Window( -left => 200, -top => 200, -width => 300, -height => 300, -name => "WIN", -text => "Static-DC-Test v2", #-noflicker => 1, # Will not work with the Paint-event ); $WIN->Show(); $DC{'color'}{'white'} = [255,255,255]; $DC{'color'}{'red'} = [255,0,0]; $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => 3, ); $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, -width => 1, ); &repaint; } sub WIN_Terminate { return -1; } sub WIN_Paint # re-/paint-event of the window { #my $DC = shift; # seems to be no need for this (in that case?) &repaint; } sub repaint # Create/rebuild DC-Object { $DC{'dc'}{'object'} = $WIN -> GetDC; $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); $DC{'dc'}{'object'} -> BeginPath(); $DC{'dc'}{'object'} -> MoveTo(10, 10); $DC{'dc'}{'object'} -> LineTo(280, 260); $DC{'dc'}{'object'} -> EndPath(); $DC{'dc'}{'object'} -> StrokePath(); # $DC{'dc'}{'object'} -> Validate(); # seems to be no need for this (in that case?) } ------------------------------------- Flickering is reduced to the times, when an other window moves over the DC-window, (or the DC-window is resizing). But in my case that's not very annoying. What I'm not getting at the moment is the thing with Validate() of the DC (seems nothing to do), or if there is a more efficient way to draw the DC. Nevertheless I hope, I can help other people with the example above. Greetings, Raphael ________________________________________ Von: Jason Plum [mailto:max@.....net] Gesendet: Montag, 9. März 2009 10:02 An: Raphael Stoeckli Cc: per...@li... Betreff: Re: [perl-win32-gui-users] flickering static-DC Hello Raphael, I unfortunately do not have a breadth of experience with the DC object as some on this list, but having seen this I can at least offer some tid-bit of possible use. I would say that the one means I can come to think of is ignoring repaint wherein there is no cause to redraw this particular rectangle. Ok, this sounds a simple concept, but I realize this may not be as easy to complete in reality. This of course, offers no help with the issue of the bad flicker during dragging, but it offers some to the regular usage flickering. Jason P On Sun, Mar 8, 2009 at 7:54 PM, Raphael Stoeckli <win32gui@.....ch> wrote: Hi @ all I try to plot a static DC-Object (means: the graphic is calculated uniquely at runtime, depending of several parameters, and does not change while displaying the window) in a window. The problem is that this object continuously needs to be redrawn, because it vanishes during moving the window around, or if an other window is moving over it. I thought, a repaint-routine like that would solve the problem: ------------------------------------- use strict; use Win32::GUI(); our $WIN; our %DC; &build_gui; Win32::GUI::Dialog(); sub build_gui # Building the GUI { $WIN = new Win32::GUI::Window( -left => 200, -top => 200, -width => 300, -height => 300, -name => "WIN", -text => "Static-DC-Test", #-noflicker => 1, # Useless/worse result ); $WIN->Show(); $DC{'color'}{'white'} = [255,255,255]; $DC{'color'}{'red'} = [255,0,0]; $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => 3, ); $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, -width => 1, ); &repaint; $DC{'timer'} = $WIN ->AddTimer("timer", 100); } sub ::timer_Timer # Repaint DC with interval of 'timer' { &repaint; } sub WIN_Terminate { return -1; } sub repaint # Create/rebuild DC-Object { $DC{'dc'}{'object'} = $WIN -> GetDC; $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); $DC{'dc'}{'object'} -> BeginPath(); $DC{'dc'}{'object'} -> MoveTo(10, 10); $DC{'dc'}{'object'} -> LineTo(280, 260); $DC{'dc'}{'object'} -> EndPath(); $DC{'dc'}{'object'} -> StrokePath(); #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? } ------------------------------------- But the result of the code above is a flickering, annoying graphic. So the next thought, was to generate a bitmap from the DC. There is, if Im not wrong, a method with DIBitmap. But, I would like to refrain from binding in that module, only for converting a single graphic, because its bloating up the program/PAR-binary. Sadly, the DC-Documentation is frequent a sealed book for me. Does anyone know an easy method (I also like to take a complex solution :-)) to convert a DC into a bitmap-object, without using DIBitmap? Or, even better, a way to prevent that flickering during the repaint? Thanks a lot. Regards, Raphael ---------------------------------------------------------------------------- -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/ -- Maximus* WarheadsSE MaxSource |
From: Jason P. <ma...@wa...> - 2009-03-09 09:27:15
|
Hello Raphael, I unfortunately do not have a breadth of experience with the DC object as some on this list, but having seen this I can at least offer some tid-bit of possible use. I would say that the one means I can come to think of is ignoring repaint wherein there is no cause to redraw this particular rectangle. Ok, this sounds a simple concept, but I realize this may not be as easy to complete in reality. This of course, offers no help with the issue of the bad flicker during dragging, but it offers some to the regular usage flickering. Jason P On Sun, Mar 8, 2009 at 7:54 PM, Raphael Stoeckli <win...@ra...>wrote: > Hi @ all > > I try to plot a static DC-Object (means: the graphic is calculated uniquely > at runtime, depending of several parameters, and does not change while > displaying the window) in a window. > The problem is that this object continuously needs to be redrawn, because > it > vanishes during moving the window around, or if an other window is moving > over it. > I thought, a repaint-routine like that would solve the problem: > ------------------------------------- > use strict; > use Win32::GUI(); > our $WIN; > our %DC; > > &build_gui; > Win32::GUI::Dialog(); > > sub build_gui # Building the GUI > { > $WIN = new Win32::GUI::Window( > -left => 200, -top => 200, -width => 300, -height => 300, > -name => "WIN", > -text => "Static-DC-Test", > #-noflicker => 1, # Useless/worse result > ); > $WIN->Show(); > $DC{'color'}{'white'} = [255,255,255]; > $DC{'color'}{'red'} = [255,0,0]; > $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => > 3, ); > $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, > -width => 1, ); > &repaint; > $DC{'timer'} = $WIN ->AddTimer("timer", 100); > } > > sub ::timer_Timer # Repaint DC with interval of 'timer' > { &repaint; } > > sub WIN_Terminate { return -1; } > > sub repaint # Create/rebuild DC-Object > { > $DC{'dc'}{'object'} = $WIN -> GetDC; > $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); > $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); > $DC{'dc'}{'object'} -> BeginPath(); > $DC{'dc'}{'object'} -> MoveTo(10, 10); > $DC{'dc'}{'object'} -> LineTo(280, 260); > $DC{'dc'}{'object'} -> EndPath(); > $DC{'dc'}{'object'} -> StrokePath(); > #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? > } > ------------------------------------- > But the result of the code above is a flickering, annoying graphic. > So the next thought, was to generate a bitmap from the DC. There is, if I’m > not wrong, a method with DIBitmap. But, I would like to refrain from > binding > in that module, only for converting a single graphic, because it’s bloating > up the program/PAR-binary. > > > Sadly, the DC-Documentation is frequent a sealed book for me. > Does anyone know an easy method (I also like to take a complex solution > :-)) > to convert a DC into a bitmap-object, without using DIBitmap? Or, even > better, a way to prevent that flickering during the repaint? > > Thanks a lot. > > Regards, > Raphael > > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > -- Maximus* WarheadsSE MaxSource |
From: Raphael S. <win...@ra...> - 2009-03-09 00:06:51
|
Hi @ all I try to plot a static DC-Object (means: the graphic is calculated uniquely at runtime, depending of several parameters, and does not change while displaying the window) in a window. The problem is that this object continuously needs to be redrawn, because it vanishes during moving the window around, or if an other window is moving over it. I thought, a repaint-routine like that would solve the problem: ------------------------------------- use strict; use Win32::GUI(); our $WIN; our %DC; &build_gui; Win32::GUI::Dialog(); sub build_gui # Building the GUI { $WIN = new Win32::GUI::Window( -left => 200, -top => 200, -width => 300, -height => 300, -name => "WIN", -text => "Static-DC-Test", #-noflicker => 1, # Useless/worse result ); $WIN->Show(); $DC{'color'}{'white'} = [255,255,255]; $DC{'color'}{'red'} = [255,0,0]; $DC{'pen'} = new Win32::GUI::Pen( -color => $DC{'color'}{'red'}, -width => 3, ); $DC{'brush'} = new Win32::GUI::Brush( -color => $DC{'color'}{'white'}, -width => 1, ); &repaint; $DC{'timer'} = $WIN ->AddTimer("timer", 100); } sub ::timer_Timer # Repaint DC with interval of 'timer' { &repaint; } sub WIN_Terminate { return -1; } sub repaint # Create/rebuild DC-Object { $DC{'dc'}{'object'} = $WIN -> GetDC; $DC{'dc'}{'object'} -> FillRect(10, 10, 280, 260,$DC{'brush'}); $DC{'dc'}{'object'} -> SelectObject($DC{'pen'}); $DC{'dc'}{'object'} -> BeginPath(); $DC{'dc'}{'object'} -> MoveTo(10, 10); $DC{'dc'}{'object'} -> LineTo(280, 260); $DC{'dc'}{'object'} -> EndPath(); $DC{'dc'}{'object'} -> StrokePath(); #$DC{'dc'}{'object'} -> Save(); # ??? Save() --> Restore() ??? } ------------------------------------- But the result of the code above is a flickering, annoying graphic. So the next thought, was to generate a bitmap from the DC. There is, if Im not wrong, a method with DIBitmap. But, I would like to refrain from binding in that module, only for converting a single graphic, because its bloating up the program/PAR-binary. Sadly, the DC-Documentation is frequent a sealed book for me. Does anyone know an easy method (I also like to take a complex solution :-)) to convert a DC into a bitmap-object, without using DIBitmap? Or, even better, a way to prevent that flickering during the repaint? Thanks a lot. Regards, Raphael |
From: Robert M. <ro...@th...> - 2009-03-04 17:16:57
|
2009/3/4 Mike Carambat <mc...@ro...>: > So far, I can get the handle on the window and even issue a CloseWindow, so I know I’m hooked into it, but I > am having trouble with sending the commands over WM_COPYDATA. As you don't have warnings turned on, and you're using cgi, you can't see the warnings/errors that perl is helpfully giving you: C:\>perl -MWin32::GUI -e "print WM_COPYDATA();" Undefined subroutine &main::WM_COPYDATA called at -e line 1. C:\>perl -w -MWin32::GUI -e "print WM_COPYDATA();" 'use Win32::GUI;' is currently exporting constants into the callers scope. This functionality is deprecated. Use 'use Win32::GUI();' or list your required expor ts explicitly instead. at -e line 0 Undefined subroutine &main::WM_COPYDATA called at -e line 1. C:\>perl -w -MWin32::GUI=WM_COPYDATA -e "print WM_COPYDATA();" 74 > #!/usr/bin/perl > # WinLiRC Perl interface > > chdir ("cgi-bin"); > > use Win32::GUI; Try changing this line to: use Win32::GUI qw(WM_COPYDATA); Win32::GUI only exports a rather small subset of the constants by default (the original exports are maintained for backward compatibility purposes). Generally you want to list the constants you require access to on the 'use Win32::GUI' line. See Win32::GUI::Constants and the release notes for further information. [I haven't checked that the rest of the script works, but it looks OK at a first glance]. Hope that helps. Rob. |
From: Mike C. <mc...@ro...> - 2009-03-04 16:30:42
|
Hi all, Trying to use Win32::GUI Perl module to programmatically control a window in Windows from Perl. The window is a program called WinLirc which is used to control and iR Blaster for controlling equipment. There’s already a command line program that interfaces with this window called transmit.exe, but I am trying to write a Perl version to make a web based interface. So far, I can get the handle on the window and even issue a CloseWindow, so I know I’m hooked into it, but I am having trouble with sending the commands over WM_COPYDATA. Not sure if I’m building and packing my command line the same way transmitdoes it. Can anyone understand what they are doing by looking at the VC++ transmit.cpp code below? Basically, you invoke transmit to send commands to the WINLirc window like this: C:/transmit.exe Cable CHNUP 1 So, I assume in transmit.cpp, the lpCmdLine value receives the value “Cable CHNUP 1” which is what I hardcoded into my corresponding $command variable in Perl, for testing purposes. Here’s the VC++ code from the transmit.cpp: int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { LRESULT copyDataResult; HWND pOtherWnd = FindWindow(NULL, "WinLirc"); if (pOtherWnd) { COPYDATASTRUCT cpd; cpd.dwData = 0; cpd.cbData = strlen(lpCmdLine); cpd.lpData = (void*)lpCmdLine; copyDataResult = SendMessage(pOtherWnd,WM_COPYDATA,(WPARAM)hInstance,(LPARAM)&cpd); // copyDataResult has value returned by other app } else { return 1; } return 0; } Anyhow here’s my best attempt at translation into Perl: #!/usr/bin/perl # WinLiRC Perl interface chdir ("cgi-bin"); use Win32::GUI; $windowtitle='WinLIRC'; $command='Cable CHNUP 1'; $handle=Win32::GUI::FindWindow('', $windowtitle); if ($handle eq "") {print "WinLIRC window not open."; exit(0);} $copy_data_struct=pack('L2P',0,length($command),$command); $result=Win32::GUI::SendMessage($handle,WM_COPYDATA,0,$copy_data_struct); print "$result" I keep getting a result code of "0" which tells me the command is failing. More than likely it's encoded wrong... Any help would be greatly appreciated! Thanks, Mike |
From: Bill W. <wrw...@fa...> - 2009-02-21 16:00:53
|
Hello, I'm trying to write a Perl / Win32::GUI application that will inject keystrokes into another application. According to MSDN the correct way is with the WH_JOURNALPLAYBACK hook. In looking over the source code for the implementation of hooks it appears that it is not a simple wrapper around *SetWindowsHookEx * ****but that it is restricted to just WH_MSGFILTER <http://msdn.microsoft.com/en-us/library/ms644959%28VS.85%29.aspx#wh_msgfilter_wh_sysmsgfilterhooks> hooks. Do the developers have any plans to support JOURNALPLAYBACK WH_JOURNALRECORD hooks? Thanks, Bill **** -- --------------------------------------------------------------------- Bill Wetzel 732-530-1128 615 Little Silver Point Road wrw...@fa... Little Silver, NJ 07739 http://www.faradic.net/~billw 40.33762n 74.01879w http://www.flickr.com/photos/wrwetzel/ --------------------------------------------------------------------- |
From: Jason P. <ma...@wa...> - 2009-02-20 17:33:19
|
> > Sat, 17 Jan 2009 12:11:56 -0800 > Hi all, I'm working on a program that, when launched, displays an icon (a Win32::GUI::NotifyIcon object) in the Windows taskbar notification area-often referred to as the "system tray". When one of the buttons on my GUI is clicked, a separate "worker" thread is created so that my GUI remains responsive while a background task executes in the other thread. Everything is fine up to that point, but when the thread eventually finishes, my icon disappears from the system tray and I get the following three lines of errors: Attempt to free non-existent shared string '_NotifyIcon1', Perl interpreter: 0x1cfc6f4 at C:/Perl/site/lib/Win32/GUI.pm line 3429 during global destruction. Unbalanced string table refcount: (1) for "" during global destruction. Unbalanced string table refcount: (1) for "DELETE" during global destruction. I'm happy to post my code, if necessary, but I thought someone might be able to quickly tell me whether Win32::GUI::NotifyIcon is thread safe. Thanks, Rob Hey Rob, I'll admit it has been a while since I've popped my head into this mailing list, but I thought I could help on this one. First I have a couple of questions tho: 1. Is this thread in control of the NotifyIcon in *any* way? 2. Which perl? 5.10 has some quirkiness I've noticed with threading an certain parts of Win32::GUI if one isn't careful. 3. Is it possible to pre-fork this thread and have it wait on instructions? (this totally bypasses this entire problem) Hope I can help :) Jason |
From: Perl R. <pe...@co...> - 2009-01-17 20:10:28
|
Hi all, I'm working on a program that, when launched, displays an icon (a Win32::GUI::NotifyIcon object) in the Windows taskbar notification area-often referred to as the "system tray". When one of the buttons on my GUI is clicked, a separate "worker" thread is created so that my GUI remains responsive while a background task executes in the other thread. Everything is fine up to that point, but when the thread eventually finishes, my icon disappears from the system tray and I get the following three lines of errors: Attempt to free non-existent shared string '_NotifyIcon1', Perl interpreter: 0x1cfc6f4 at C:/Perl/site/lib/Win32/GUI.pm line 3429 during global destruction. Unbalanced string table refcount: (1) for "" during global destruction. Unbalanced string table refcount: (1) for "DELETE" during global destruction. I'm happy to post my code, if necessary, but I thought someone might be able to quickly tell me whether Win32::GUI::NotifyIcon is thread safe. Thanks, Rob |