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: <Kev...@al...> - 2001-11-05 11:13:27
|
The only problem I've had with GUI and OLE is that OLE::Constants doesn= 't work. Apart from that it works fine. Aldo seems to have gone very quiet on new releases but then again he se= ems to be developing all the XS code on his own. A big project for just on= e person I'd say. Anyone sufficiently competent with XS to lend a hand? Sadly, my attempts at XS haven't got me very far. Kev. = =20 "Peter K=F6ller" = = <pko...@me...> To: = "Jason Bingham" <jas...@gb...>, =20 Sent by: <perl= -wi...@li...> =20 per...@li...urc cc: = =20 eforge.net Subje= ct: RE: [perl-win32-gui-users] GUI & OLE (WAS: Drag-n-Drop?) =20 = =20 = =20 05/11/2001 07:05 = =20 = =20 = =20 > I have had no problems with combining the use of Win32::GUI & > Win32::OLE in > the same application. Currently I have a Win32::GUI program that > sits in the > systray and communicates (read / write) to Outlook calendar & tasks v= ia > Win32::OLE. > Is there any code that shows the problems.... I think I can find a pieve of code on my harddisk which shows the probl= ems. Please wait for the end of this week because I am busy. Peter = |
From: Johannes G. <in...@de...> - 2001-11-05 09:47:01
|
ups .. sorry i've forgott to delete the replay information on my message before :-)) sorry Marcus :-) Hannes -- Mit freundlichen Grüssen Johannes Gamperl mailto:in...@de... |
From: Johannes G. <in...@de...> - 2001-11-05 09:39:10
|
Guten Tag Marcus, Am Sonntag, 4. November 2001 um 14:52 schrieben Sie: M> On 04.11.01 at 06:28 Mark Wilkinson wrote: >>The real question is this: how do you get your variables into your M> widget >>event >>control subroutines? e.g. the code below: >> >>use strict; >>my $x = 1; >> >>sub Button_Click { >> ++$x >>} M> Well, I think you need to declare subs as: M> sub main::Button_Click { M> or at the latest when you have an external widget, your events won't be M> processed. I just figured that one out again, or should I say I M> remembered what I'd read in the manual :-) M> and for your $x, call it $main::x. Hello, i'm new to Win32::GUI .. so i've a question about the options of the widgets. Is ther a list of all available options to the relevant widgets ...? thx a lot for your help ;-) Hannes -- Mit freundlichen Grüssen Johannes Gamperl mailto:in...@de... |
From: <pko...@me...> - 2001-11-05 07:06:03
|
> I have had no problems with combining the use of Win32::GUI & > Win32::OLE in > the same application. Currently I have a Win32::GUI program that > sits in the > systray and communicates (read / write) to Outlook calendar & tasks via > Win32::OLE. > Is there any code that shows the problems.... I think I can find a pieve of code on my harddisk which shows the problem= s. Please wait for the end of this week because I am busy. Peter > -----Original Message----- > From: per...@li... > [mailto:per...@li...]On Behalf Of > Jason Bingham > Sent: Monday, November 05, 2001 12:04 AM > To: per...@li... > Subject: RE: [perl-win32-gui-users] GUI & OLE (WAS: Drag-n-Drop?) > > > I have had no problems with combining the use of Win32::GUI & > Win32::OLE in > the same application. Currently I have a Win32::GUI program that > sits in the > systray and communicates (read / write) to Outlook calendar & tasks via > Win32::OLE. > > Is there any code that shows the problems.... > > Here is a quick and dirty modified hello.pl from the samples that conne= cts > to outlook and reads the subject of the first item in the inbox > and changes > the button text. > > use Win32::GUI; > use Win32::OLE; > use Win32::OLE::Variant; > use Win32::OLE::Const 'Microsoft Outlook'; > > $MW =3D new Win32::GUI::Window( > -title =3D> 'hello.pl', > -left =3D> 100, > -top =3D> 100, > -width =3D> 150, > -height =3D> 100, > -name =3D> 'MainWindow', > -visible =3D> 1, > ); > > $hello =3D $MW->AddButton( > -text =3D> 'Hello, world', > -name =3D> 'Hello', > -left =3D> 25, > -top =3D> 25, > ); > > $rc =3D Win32::GUI::Dialog(0); > > sub MainWindow_Terminate { > $MW->PostQuitMessage(1); > # return -1; > } > > sub Hello_Click { > # Connect to Outlook > my $Outlook =3D Win32::OLE->new('Outlook.Application', ''); > > # Connect to active session & Get subject of first message > my $namespace =3D $Outlook->GetNamespace("MAPI"); > my $folder =3D $namespace->GetDefaultFolder(olFolderInbox); > my $Subject =3D $folder->{Items}->Item(1)->{Subject}; > > # Update Button Text > $MW->Hello->{-text} =3D "$Subject"; > } > > > > > -----Original Message----- > From: Peter K=F6ller [mailto:pko...@me...] > Sent: Monday, 5 November 2001 2:35 AM > To: per...@li... > Subject: RE: [perl-win32-gui-users] Drag-n-Drop? > > > > But a Win32::GUI 0.0.559 with DnD-support would be nice. Aldo? > > First, I would appreciate a Win32::GUI which works with > Win32::OLE ;-) Aldo? > > Peter > > > > -----Original Message----- > > From: per...@li... > > [mailto:per...@li...]On Behalf Of > > Johan Lindstrom > > Sent: Sunday, November 04, 2001 4:38 PM > > To: per...@li... > > Subject: Re: [perl-win32-gui-users] Drag-n-Drop? > > > > > > Margus wrote: > > >On the other hand, is anyone able to compile a PPM of Win32::GUI wit= h > > >drag and drop functionality? > > > > Hmmm... wouldn't want to spread a rouge distribution of > > Win32::GUI, this is > > confusing enough as it is. > > > > But a Win32::GUI 0.0.559 with DnD-support would be nice. Aldo? > > > > > > /J > > > > ------ ---- --- -- -- -- - - - - - > > Johan Lindstr=F6m Boss Casinos > > Sourcerer jo...@ba... > > http://www.bahnhof.se/~johanl/ > > If the only tool you have is a hammer, > > everything tends to look > > like a nail > > > > > > > > _______________________________________________ > > Perl-Win32-GUI-Users mailing list > > Per...@li... > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > |
From: Glenn L. <Gle...@ne...> - 2001-11-05 07:03:54
|
I'd sure like to see this capability (even if not this exact code) in a future release... Win32 GUI seems to deal better with shutdown on WinNT/2K than 9x. Sean Healy wrote: > I have not been successful. PeekMessage doesn't seem to work at all, and > all I could get GetMessage to catch were menu clicks (my application has a > NotifyIcon, but I never call Show on the main window). To solve my original > problem, I simply have my application write to file each time a setting > changes. An inelegant and inefficient solution, but it works. > > I think if something like the following were to be added to the main message > loop in GUI.xs (perhaps between case WM_SYSCOMMAND and case WM_SIZE), it > would work. > > case WM_QUERYENDSESSION: > if(GetObjectName(NOTXSCALL hwnd, Name)) { > /* > * (@)EVENT:Shutdown() > * Sent when Windows is about to shut down. > * (@)APPLIES_TO:Window, DialogBox > */ > strcat(Name, "_Shutdown"); > PerlResult = DoEvent_Generic(NOTXSCALL Name); > } > break; > > Then {WindowName}_Shutdown would be called whenever Windows is about to shut > down. According to what I was able to discover, if an application returns > false, Windows stops the shutdown process. So returning 1 or 0 should work > as expected; I believe returning -1 from your sub would end the Dialog > phase, but that Win32::GUI would then return a 1, so Windows would shut > down. > > If anyone wants to test this out (I do not have a compiler), that would be > nice. Perhaps it could be included in the next release if it works. Then, > again, it's only really useful for something that runs during the entire > Windows session, like my application or a daemon, so perhaps it's not really > necessary. > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users -- Glenn ===== Due to the current economic situation, the light at the end of the tunnel will be turned off until further notice. |
From: Jason B. <jas...@gb...> - 2001-11-04 23:03:34
|
I have had no problems with combining the use of Win32::GUI & = Win32::OLE in the same application. Currently I have a Win32::GUI program that sits = in the systray and communicates (read / write) to Outlook calendar & tasks via Win32::OLE. Is there any code that shows the problems.... Here is a quick and dirty modified hello.pl from the samples that = connects to outlook and reads the subject of the first item in the inbox and = changes the button text. use Win32::GUI; use Win32::OLE; use Win32::OLE::Variant; use Win32::OLE::Const 'Microsoft Outlook'; $MW =3D new Win32::GUI::Window( -title =3D> 'hello.pl', -left =3D> 100, -top =3D> 100, -width =3D> 150, -height =3D> 100, -name =3D> 'MainWindow', -visible =3D> 1, ); $hello =3D $MW->AddButton( -text =3D> 'Hello, world', -name =3D> 'Hello', -left =3D> 25, -top =3D> 25, ); $rc =3D Win32::GUI::Dialog(0); sub MainWindow_Terminate { $MW->PostQuitMessage(1); # return -1; } sub Hello_Click { # Connect to Outlook my $Outlook =3D Win32::OLE->new('Outlook.Application', ''); # Connect to active session & Get subject of first message my $namespace =3D $Outlook->GetNamespace("MAPI"); my $folder =3D $namespace->GetDefaultFolder(olFolderInbox); my $Subject =3D $folder->{Items}->Item(1)->{Subject}; # Update Button Text $MW->Hello->{-text} =3D "$Subject"; } -----Original Message----- From: Peter K=F6ller [mailto:pko...@me...] Sent: Monday, 5 November 2001 2:35 AM To: per...@li... Subject: RE: [perl-win32-gui-users] Drag-n-Drop? > But a Win32::GUI 0.0.559 with DnD-support would be nice. Aldo? First, I would appreciate a Win32::GUI which works with Win32::OLE ;-) = Aldo? Peter > -----Original Message----- > From: per...@li... > [mailto:per...@li...]On Behalf Of > Johan Lindstrom > Sent: Sunday, November 04, 2001 4:38 PM > To: per...@li... > Subject: Re: [perl-win32-gui-users] Drag-n-Drop? > > > Margus wrote: > >On the other hand, is anyone able to compile a PPM of Win32::GUI = with > >drag and drop functionality? > > Hmmm... wouldn't want to spread a rouge distribution of > Win32::GUI, this is > confusing enough as it is. > > But a Win32::GUI 0.0.559 with DnD-support would be nice. Aldo? > > > /J > > ------ ---- --- -- -- -- - - - - - > Johan Lindstr=F6m Boss Casinos > Sourcerer jo...@ba... > http://www.bahnhof.se/~johanl/ > If the only tool you have is a hammer, > everything tends to look > like a nail > > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: Mark W. <ma...@il...> - 2001-11-04 20:36:41
|
> Example of creating a Click event handler that passes a certain object > ($objControl) for each control to a single sub: > #Create the event handler > my $perlEvent = qq{ > { > my \$obj = \$objControl; #Nice little closure > sub ::${name}_Click { #Adding new subs _will_ leak memory... > ::mnuPopupSelect(\$obj); > } > } > }; > eval $perlEvent; #...not to mention string eval > print "Error: $@" if($@); this is very pretty (esp. the sneaky closure at the beginning!! trez cool!) I'll give that a try when I go back to my other machine later today... I still can't help but say "it shouldn't take cool and sneaky tricks to accomplish this...". :-) > I thought so too but then I looked in the XS code. While it's obviously > doable (most things are), I'm not convinced it's a walk in the park. Hmmm... I was probably assuming too much. I haven't looked at that code, but I assumed that the widget that was being manipulated would 'intuitively' know about itself, and thus events involving that widget could easily send the widget-ref to the callback... unless the widget-event and the widget are somehow "separated" (e.g. if the event triggered is based on global mouse-coordinates, rather than being triggered from within the widget... ugh!) Anyway, your code example is really sweet! I think between your example, and Morbus' global hash-ref-trash-can idea I can work around the problems that I have had so far. Thanks guys! Mark |
From: <Jos...@DM...> - 2001-11-04 20:07:34
|
I ran into this problem with global variables about two weeks ago when I was trying to write a nice little program to run sql queries to any database connection (as opposed to using sqlplus for oracle isql_w for ms-sql etc...). It does seem contradictory to basic programming to use global variables for most of your code. I read all the replies and realized that I'm still a newbie when it comes to programming especially in PERL, I have no idea what a singleton is. What I did was create the windows in separate subroutines and then used semiprivate variables using local instead of my. Since the window was created in the subroutine all the variables are only defined in the scope of the that subroutine and any other subroutines called from it, such as Window_Click(). Once the program exits that subroutine all the variables are dropped so I don't waste any memory which I would if they were global and I can use the variables with the same name in any other subroutine. Also I think that the use of semiprivate variables will not cause any warning or errors if you have "use strict". I'm not sure though. This might not be the best way of getting around the problem but it works for me and my limited skills so I thought I would mention it. If I'm wrong on any of this or have made things worse with my approach let me know. I will be happy to post my code of the program I am working on if anyone wants to see it, just remember I'm still working on it so it's not perfect and I still have to make several changes (it's only been two weeks) but it will show you what I am doing. Joe Mark Wilkinson <ma...@il...>@lists.sourceforge.net on 11/03/2001 07:31:12 PM Please respond to ma...@il... Sent by: per...@li... To: cc: per...@li... (bcc: Joseph Vieira/DMR/CA) Subject: [perl-win32-gui-users] ACK!! Sputter Cough... say it isn't so! Someone please... save me before I choke! Please say it isn't so!! Tonight I really started to build a serious heavy-duty Win32::GUI application, and I immediately hit a wall: Is it really not possible to (usefully) program in Win32::GUI while under "use strict"?!? I say this because there appears to be **nothing** passed to the event-handling subroutines - not even a reference to the widget itself! This, IMHO, is absolutely insane! That means that all of my widget refs, and every variable that is required in the event-handling subroutines, have to be global variables... which would make comp-sci professors roll over in their future graves... a "good" program should never need to have a *single* global variable, let alone *every* variable being global. If even the widget ref was sent to the event-handler I could attach the subroutine's required variables to its hash, but as things are it seems to break every rule I know about "good" programming style. I must be missing something... Please, someone, tell me that it doesn't really work this way... Mark _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: Sean H. <jal...@ho...> - 2001-11-04 19:34:19
|
I have not been successful. PeekMessage doesn't seem to work at all, and all I could get GetMessage to catch were menu clicks (my application has a NotifyIcon, but I never call Show on the main window). To solve my original problem, I simply have my application write to file each time a setting changes. An inelegant and inefficient solution, but it works. I think if something like the following were to be added to the main message loop in GUI.xs (perhaps between case WM_SYSCOMMAND and case WM_SIZE), it would work. case WM_QUERYENDSESSION: if(GetObjectName(NOTXSCALL hwnd, Name)) { /* * (@)EVENT:Shutdown() * Sent when Windows is about to shut down. * (@)APPLIES_TO:Window, DialogBox */ strcat(Name, "_Shutdown"); PerlResult = DoEvent_Generic(NOTXSCALL Name); } break; Then {WindowName}_Shutdown would be called whenever Windows is about to shut down. According to what I was able to discover, if an application returns false, Windows stops the shutdown process. So returning 1 or 0 should work as expected; I believe returning -1 from your sub would end the Dialog phase, but that Win32::GUI would then return a 1, so Windows would shut down. If anyone wants to test this out (I do not have a compiler), that would be nice. Perhaps it could be included in the next release if it works. Then, again, it's only really useful for something that runs during the entire Windows session, like my application or a daemon, so perhaps it's not really necessary. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |
From: Johan L. <jo...@ba...> - 2001-11-04 17:15:14
|
At 10:55 2001-11-04 -0600, Mark Wilkinson wrote: > > > I say this because there appears to be **nothing** passed > > This isn't so. > >well... an examination of @_ at the beginning of the event handling >subroutines >says it is so... nothing is *passed* Ah. I was referring to your comment about using strict. Some things are passed to some types of event handlers, but never the window or control itself. > > What you need is an entry point to your window variables. From there you > > can access all the contained controls. > >Window variables, yes, but other program variables (which may be required >by that >subroutine) no. Ok, then take a look at the Singleton approach in TGL and Perl Oasis. They use one singleton for each window, but you can have one "application" singleton which contains the window objects and the rest of your application logic. >Granted, Win32GUI handles this in its own way, by requiring that each >widget have >a "name", and that name becomes part of the name of the event-handling >subroutine... but... ugh! If I am dynamically generating multiple copies >of the >same widget (thus with the same name) how do I know which instance was >clicked if >the widget ref is not passed back to the event handler? You don't do that. Empty your glass before you fill it. If you create controls dynamically, you don't give them the same name. If you create controls dynamically, you also create the event handlers dynamically (probably they just call some other sub to do the actual processing). Example of creating a Click event handler that passes a certain object ($objControl) for each control to a single sub: #Create the event handler my $perlEvent = qq{ { my \$obj = \$objControl; #Nice little closure sub ::${name}_Click { #Adding new subs _will_ leak memory... ::mnuPopupSelect(\$obj); } } }; eval $perlEvent; #...not to mention string eval print "Error: $@" if($@); (I have since learned that there are better ways than "eval STRING" to add subs.) >Agreed... it isn't "all that bad", but it is limiting/frustrating >nonetheless... >especially given how simple it would be to add this functionality (i.e. >the widget >ref must be available inside of the widget code itself, deep in the guts of >Win32GUI, and thus be available to the code making the callback... so >there is no >obvious reason why it couldn't be passed...) I thought so too but then I looked in the XS code. While it's obviously doable (most things are), I'm not convinced it's a walk in the park. /J ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |
From: Piske, H. <Har...@bo...> - 2001-11-04 17:14:02
|
<excerpt> Agreed... it isn't "all that bad", but it is limiting/frustrating nonetheless... especially given how simple it would be to add this functionality (i.e. the widget ref must be available inside of the widget code itself, deep in the guts of Win32GUI, and thus be available to the code making the callback... so there is no obvious reason why it couldn't be passed...) </excerpt> Maybe this is another good time to ask, *cough, cough*, "erm, hello, Aldo? What about the new event model?" I understand that takes care of this stuff. The problem as I see it, the more hot GUI stuff is out there, the less willing people are gonna be stepping up to this new GUI. |
From: Mark W. <ma...@il...> - 2001-11-04 16:53:06
|
Johan Lindstrom wrote: > > I say this because there appears to be **nothing** passed > This isn't so. well... an examination of @_ at the beginning of the event handling subroutines says it is so... nothing is *passed* > No, but it's very impractical. I felt the same thing when I started using > Win32::GUI. Glad to have company :-) > Obviously you haven't reached the "Singleton" chapter in your patterns book :) not yet, no ;-) > What you need is an entry point to your window variables. From there you > can access all the contained controls. Window variables, yes, but other program variables (which may be required by that subroutine) no. > But polluting the global name space with loads of vars is not necessary if > you use a single list or hash for storing the window objects. That way you > only have one global variable to keep track of. agreed... in fact, Morbus does exactly this and I can see that this is how I will have to proceed. Still, this architecture really does prevent you from achieving a lot of OO functionality (eg. extension). This is one of the main reasons that I wanted to mix Win32GUI and Tk - in Tk the widget ref itself is the first thing passed into all event handlers, so I always know which widget I am dealing with. Granted, Win32GUI handles this in its own way, by requiring that each widget have a "name", and that name becomes part of the name of the event-handling subroutine... but... ugh! If I am dynamically generating multiple copies of the same widget (thus with the same name) how do I know which instance was clicked if the widget ref is not passed back to the event handler? > I'm not saying that it wouln't be _better_ having the window object passed > to the event handler (it would), I'm saying it doesn't have to be all that > bad using a single global to accomplish almost the same thing. Agreed... it isn't "all that bad", but it is limiting/frustrating nonetheless... especially given how simple it would be to add this functionality (i.e. the widget ref must be available inside of the widget code itself, deep in the guts of Win32GUI, and thus be available to the code making the callback... so there is no obvious reason why it couldn't be passed...) It would be nice to at least be able to define a hash or a list of variables during widget construction that would be passed to any event handler. ... na ja... just me being grumpy again :-) Thanks (everyone!) for all of your tips! Cheers, M |
From: Morbus I. <mo...@di...> - 2001-11-04 16:51:55
|
>in fact, it explicitly declares them as globals in the use vars statement... >I am trying to *avoid* declaring all of my variables as globals... Ah. Ok. I was showing AmphetaDesk as "yes, it can be done with strict", and also gave the warning you just re-stated: At 8:39 PM -0500 11/3/01, Morbus Iff wrote: >And yes, within the Windows routines (/lib/Windows.pl), >I use global variables. Que sera. -- Morbus Iff ( i am your scary godmother ) http://www.disobey.com/ && http://www.gamegrene.com/ please me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554 icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus |
From: Morbus I. <mo...@di...> - 2001-11-04 16:51:19
|
>this will fail because there is no way (AFAIK) to pass $x into the >subroutine >the result of a click... I had a look at the AmphetaDesk code >that Morbus >suggested (I haven't looked at auctioneer yet...), but that doesn't seem >to use >strict in all of its modules, so that doesn't count. Not sure what you're talking about - currently, AmphetaDesk is very perl4ish - there are no modules, only libraries. The libraries are sucked in from the main AmphetaDesk.pl script, and inherit the use strict and -w. -- Morbus Iff ( i am your scary godmother ) http://www.disobey.com/ && http://www.gamegrene.com/ please me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554 icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus |
From: <pko...@me...> - 2001-11-04 16:38:55
|
> But a Win32::GUI 0.0.559 with DnD-support would be nice. Aldo? First, I would appreciate a Win32::GUI which works with Win32::OLE ;-) Al= do? Peter > -----Original Message----- > From: per...@li... > [mailto:per...@li...]On Behalf Of > Johan Lindstrom > Sent: Sunday, November 04, 2001 4:38 PM > To: per...@li... > Subject: Re: [perl-win32-gui-users] Drag-n-Drop? > > > Margus wrote: > >On the other hand, is anyone able to compile a PPM of Win32::GUI with > >drag and drop functionality? > > Hmmm... wouldn't want to spread a rouge distribution of > Win32::GUI, this is > confusing enough as it is. > > But a Win32::GUI 0.0.559 with DnD-support would be nice. Aldo? > > > /J > > ------ ---- --- -- -- -- - - - - - > Johan Lindstr=F6m Boss Casinos > Sourcerer jo...@ba... > http://www.bahnhof.se/~johanl/ > If the only tool you have is a hammer, > everything tends to look > like a nail > > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > |
From: Johan L. <jo...@ba...> - 2001-11-04 16:30:57
|
At 18:31 2001-11-03 -0600, Mark Wilkinson wrote: >Someone please... save me before I choke! Please say it isn't so!! >Tonight I really started to build a serious heavy-duty Win32::GUI >application, and I immediately hit a wall: > >Is it really not possible to (usefully) program in Win32::GUI while under >"use strict"?!? I say this because there appears to be **nothing** passed This isn't so. But it's unfortunate that none of the provided sample scripts use strict and warnings. >to the event-handling subroutines - not even a reference to the widget >itself! This, IMHO, is absolutely insane! No, but it's very impractical. I felt the same thing when I started using Win32::GUI. >That means that all of my widget refs, and every variable that is required >in the event-handling subroutines, have to be global variables... Obviously you haven't reached the "Singleton" chapter in your patterns book :) >which would make comp-sci professors roll over in their future graves... a >"good" program should never need to have a *single* global variable, let >alone *every* variable being global. If even the widget ref was sent to >the event-handler I could attach the subroutine's required variables to >its hash, but as things are it seems to break every rule I know about >"good" programming style. What you need is an entry point to your window variables. From there you can access all the contained controls. 1. You can do this with e.g. a singleton class for each of your windows. In each event handler you instansiate a new (i.e. the same) object of your class wich contains a property with your window object. Examples: The GUI Loft and Perl Oasis: http://www.bahnhof.se/~johanl/perl/ 2. You can also do this with globals. Yes, it's poor form. In general it's a bad idea. But you should understand _why_ it's bad before you shun them. Globals are bad because (among other things) they introduce side effects at the largest possible scope. They increase what you need to know about a piece of code in order to understand it. Bad, bad, bad. The way Win32::GUI works, they're very useful. After all, the nice, cool, com-sci approved singleton is really just an entry point to a single object -- a global object (with a twist, admittedly). And the way the globals are used makes it possible to think about this like we were back in Object Oriented Land again * relief * But polluting the global name space with loads of vars is not necessary if you use a single list or hash for storing the window objects. That way you only have one global variable to keep track of. Example: This is how you manage your windows built with The GUI Loft. An event handler might look like this: sub ::btnFetch_Click { defined(my $win = $Win32::GUI::Loft::window{winFetch}) or return(1); my $url = $win->tfURL->Text(); #Do something with the $url return(1); } I'm not saying that it wouln't be _better_ having the window object passed to the event handler (it would), I'm saying it doesn't have to be all that bad using a single global to accomplish almost the same thing. /J ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |
From: Johan L. <jo...@ba...> - 2001-11-04 16:15:41
|
Margus wrote: >On the other hand, is anyone able to compile a PPM of Win32::GUI with >drag and drop functionality? Hmmm... wouldn't want to spread a rouge distribution of Win32::GUI, this is confusing enough as it is. But a Win32::GUI 0.0.559 with DnD-support would be nice. Aldo? /J ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |
From: Marcus <li...@wo...> - 2001-11-04 13:53:00
|
On 04.11.01 at 06:28 Mark Wilkinson wrote: >The real question is this: how do you get your variables into your widget >event >control subroutines? e.g. the code below: > >use strict; >my $x = 1; > >sub Button_Click { > ++$x >} Well, I think you need to declare subs as: sub main::Button_Click { or at the latest when you have an external widget, your events won't be processed. I just figured that one out again, or should I say I remembered what I'd read in the manual :-) and for your $x, call it $main::x. I've been wrestling with this stuff too. I just wrote a remote FTP directory selector which sits in a separate module and in order to set the Textfield I have to say $main::win->RemoteDirectoryTextField->Text("..."); You can't use a return value because that gets sent back to Win32::GUI's main loop and that wants to receive 0,1, or -1 only. I think that's correct isn't it? Marcus |
From: Mark W. <ma...@il...> - 2001-11-04 12:43:33
|
> I had a look at the AmphetaDesk code that Morbus > suggested but that doesn't seem to use > strict in all of its modules, so that doesn't count. in fact, it explicitly declares them as globals in the use vars statement... I am trying to *avoid* declaring all of my variables as globals... M |
From: Mark W. <ma...@il...> - 2001-11-04 12:26:44
|
Hey Peter! Wie geht's? :-) Hey Morbus! > I had no problems with "use strict" (you can have a look at my source code > http://sourceforge.net/projects/auctioneer/) The real question is this: how do you get your variables into your widget event control subroutines? e.g. the code below: use strict; my $x = 1; sub Button_Click { ++$x } this will fail because there is no way (AFAIK) to pass $x into the subroutine as the result of a click... I had a look at the AmphetaDesk code that Morbus suggested (I haven't looked at auctioneer yet...), but that doesn't seem to use strict in all of its modules, so that doesn't count. I'm still not convinced that it is possible... M |
From: Marcus <li...@wo...> - 2001-11-04 10:28:22
|
On 03.11.01 at 06:11 Sean Healy wrote: >Johan Lindstrom has added this functionality - but it requires recompiling >GUI.xs.* Johan's stuff is here (he'll probably post it as well, but just >in >case): >http://www.bahnhof.se/~johanl/perl/Win32GUI/DragDrop.pm Since we've discovered that you can mix Tk with Win32::GUI, you could try using Tk's drag and drop. On the other hand, is anyone able to compile a PPM of Win32::GUI with drag and drop functionality? Marcus |
From: Marcus <li...@wo...> - 2001-11-04 10:28:22
|
On 04.11.01 at 12:52 Rogers, John wrote: >>Is there a message that Windows sends out? In that case, I could >use > >PeekMessage. >Try windows mesages, >WM_QUERYENDSESSION >and WM_ENDSESSION I found that information too once, but I don't know how to implement it. How do you use PeekMessage? Marcus |
From: <pko...@me...> - 2001-11-04 09:10:07
|
> Tonight I really started to build a serious heavy-duty Win32::GUI > application, and I immediately hit a wall: I had no problems with "use strict" (you can have a look at my source code http://sourceforge.net/projects/auctioneer/) But I hit a wall with Win32::GUI in connection with Win32::OLE! When using Win32::OLE and a Win32::GUI, you will get an "Can't locate auto/....al" error. Peter > -----Original Message----- > From: per...@li... > [mailto:per...@li...]On Behalf Of > Mark Wilkinson > Sent: Sunday, November 04, 2001 1:31 AM > Cc: per...@li... > Subject: [perl-win32-gui-users] ACK!! Sputter Cough... say it isn't so! > > > Someone please... save me before I choke! Please say it isn't so!! > Tonight I really started to build a serious heavy-duty Win32::GUI > application, and I immediately hit a wall: > > Is it really not possible to (usefully) program in Win32::GUI while under > "use strict"?!? I say this because there appears to be **nothing** passed > to the event-handling subroutines - not even a reference to the widget > itself! This, IMHO, is absolutely insane! That means that all of my > widget refs, and every variable that is required in the event-handling > subroutines, have to be global variables... which would make comp-sci > professors roll over in their future graves... a "good" program should > never need to have a *single* global variable, let alone *every* variable > being global. If even the widget ref was sent to the > event-handler I could > attach the subroutine's required variables to its hash, but as things are > it seems to break every rule I know about "good" programming style. > > I must be missing something... Please, someone, tell me that it doesn't > really work this way... > > Mark > > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > |
From: David S. <sta...@me...> - 2001-11-04 05:27:09
|
Does anyone know how to set the state of checkboxes in a Listview? Thanks, |
From: Rogers, J. <rog...@oc...> - 2001-11-04 01:53:17
|
>Is there a message that Windows sends out? In that case, I could use >PeekMessage. Try windows mesages, WM_QUERYENDSESSION and WM_ENDSESSION You can read about them on MSDN or this usefull link I got from list awhile ago. <http://www.sxlist.com/techref/os/win/win32prg.htm> If you get this to work please post result. JohnR |