From: Darryl R. <bo...@af...> - 2005-03-11 00:57:47
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hey All, I need create a program which will be used by various people to upload rather large files (~ 50Mb) to a server. I've been thinking of using either ftp or rsync. At the moment I'm looking into the ftp option. I have 2 questions: 1) Has wxFTP been wrapped? 2) Is it possible to get some feedback from the module as to the status of the upload (eg, the amount sent so far / percent done so far) which would then be displayed to the user using a wxGauge type widget. I'm guessing that I'll need to run 2 threads, one to update the GUI and one to handle the ftp conversation. If (2) is possible, would running multi-threaded cause any problems? The target platform is Win32, if that makes any difference. TIA Darryl -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) iD8DBQFCMOdE/XQ6DbmPjokRAkbcAJ42cOmE6I8ys+BzgpFT5287cfI/yACghXaM TZyS4QqNzeQuI21BXQxkhEM= =W2fx -----END PGP SIGNATURE----- |
From: mattia\.barbon\@libero\.it <mat...@li...> - 2005-03-11 08:10:18
|
Hello, > I need create a program which will be used by various peopl= e to upload > rather large files (~ 50Mb) to a server. I've been thinkin= g of using > either ftp or rsync. > > At the moment I'm looking into = the ftp option. I have 2 questions: > > 1) Has wxFTP been wrapped? =0D = No, and it will not (by me). LWP or Net::FTP or any other Perl module = for handling FTP is surely far superior to wxFTP. > 2) Is it possibl= e to get some feedback from the module as to the status > of the upload = (eg, the amount sent so far / percent done so far) which > would then be= displayed to the user using a wxGauge type widget. It all depends f= rom the module, of corse. > I'm guessing that I'll need to run 2 thre= ads, one to update the GUI and > one to handle the ftp conversation. If = (2) is possible, would running > multi-threaded cause any problems? =0D = I do not know if anybody has written a multi threaded application with= wxPerl. I think using two threads is the best approach. Regards Mat= tia =0A=0A=0A=0A________________________________________________________= ____=0A6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Lib= ero!=0AScaricalo su INTERNET GRATIS 6X http://www.libero.it=0A |
From: Huub P. <hu...@tr...> - 2005-03-11 08:16:28
|
I created that functionality using Net::FTP in one of my apps a while ago. I'll extract the necessary code today and post a working example. Please be patient for a few hours :-) Regards, Huub Peters. ----- Original Message ----- From: <mat...@li...> To: "bofh" <bo...@af...> Cc: "wxperl-users" <wxp...@li...> Sent: Friday, March 11, 2005 9:10 AM Subject: Re:[wxperl-users] wxFTP and progress information Hello, > I need create a program which will be used by various people to upload > rather large files (~ 50Mb) to a server. I've been thinking of using > either ftp or rsync. > > At the moment I'm looking into the ftp option. I have 2 questions: > > 1) Has wxFTP been wrapped? No, and it will not (by me). LWP or Net::FTP or any other Perl module for handling FTP is surely far superior to wxFTP. > 2) Is it possible to get some feedback from the module as to the status > of the upload (eg, the amount sent so far / percent done so far) which > would then be displayed to the user using a wxGauge type widget. It all depends from the module, of corse. > I'm guessing that I'll need to run 2 threads, one to update the GUI and > one to handle the ftp conversation. If (2) is possible, would running > multi-threaded cause any problems? I do not know if anybody has written a multi threaded application with wxPerl. I think using two threads is the best approach. Regards Mattia ____________________________________________________________ 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick _______________________________________________ wxperl-users mailing list wxp...@li... https://lists.sourceforge.net/lists/listinfo/wxperl-users |
From: Huub P. <hu...@tr...> - 2005-03-11 16:23:44
|
Here we go.. I attached a working example that uses Net::FTP with a nice progress bar, without the need of using threads. The GUI is generated with wxGlade (can send the sourcefile to on request) and I tried to document my code a bit so I hope it's clear enough ;-) The whole thing can be extended with loads of other functions but this is just to show a working progress bar when uploading a single file. One could easily alter it to use a wxProgressDialog that gives a nice Cancel function. Bear in mind I tested and created this on Win32 but I can't see anything why it shouldn't work on any other platform. Always curious for some feedback! Regards, Huub Peters. ----- Original Message ----- From: "Huub Peters" <hu...@tr...> To: <mat...@li...>; "bofh" <bo...@af...> Cc: "wxperl-users" <wxp...@li...> Sent: Friday, March 11, 2005 9:16 AM Subject: Re: Re:[wxperl-users] wxFTP and progress information I created that functionality using Net::FTP in one of my apps a while ago. I'll extract the necessary code today and post a working example. Please be patient for a few hours :-) Regards, Huub Peters. ----- Original Message ----- From: <mat...@li...> To: "bofh" <bo...@af...> Cc: "wxperl-users" <wxp...@li...> Sent: Friday, March 11, 2005 9:10 AM Subject: Re:[wxperl-users] wxFTP and progress information Hello, > I need create a program which will be used by various people to upload > rather large files (~ 50Mb) to a server. I've been thinking of using > either ftp or rsync. > > At the moment I'm looking into the ftp option. I have 2 questions: > > 1) Has wxFTP been wrapped? No, and it will not (by me). LWP or Net::FTP or any other Perl module for handling FTP is surely far superior to wxFTP. > 2) Is it possible to get some feedback from the module as to the status > of the upload (eg, the amount sent so far / percent done so far) which > would then be displayed to the user using a wxGauge type widget. It all depends from the module, of corse. > I'm guessing that I'll need to run 2 threads, one to update the GUI and > one to handle the ftp conversation. If (2) is possible, would running > multi-threaded cause any problems? I do not know if anybody has written a multi threaded application with wxPerl. I think using two threads is the best approach. Regards Mattia ____________________________________________________________ 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick _______________________________________________ wxperl-users mailing list wxp...@li... https://lists.sourceforge.net/lists/listinfo/wxperl-users ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ wxperl-users mailing list wxp...@li... https://lists.sourceforge.net/lists/listinfo/wxperl-users |
From: Olivier J. <oli...@hp...> - 2005-03-14 08:57:40
|
Huub Peters wrote: >Here we go.. > >I attached a working example that uses Net::FTP with a nice progress bar, >without the need of using threads. > Peters, this is a nice one! Thanks. Olivier. |
From: Mark W. <ma...@ne...> - 2005-03-11 08:23:15
|
Hi All, I am trying to enhance the printing and previewing side of things ... I have a Wx::Dialog with report related options and buttons that launch a Wx::PreviewFrame by means of a Preview button. With the PreviewFrame active and I have clicked on the Print canvas to be sure, if I push Enter the default button on the dialog (now hidden and behind the PreviewFrame) is activated and another preview frame is created, if I press the Escape key the wxID_CANCEL button is activated and the dialog closes leaving the PreviewFrame on screen. Has anyone had any experience with this? Is there anyway to override the CreateControlBar or Initialize methods? If I could do this then I could try and look at control focus issues regrading above problem. I could also create my own ControlBar with improved features. Many thanks Mark |
From: Mattia B. <mat...@li...> - 2005-03-13 07:36:16
|
On Fri, 11 Mar 2005 10:22:38 +0200 Mark Wardell <ma...@ne...> wrote: Hello, > I am trying to enhance the printing and previewing side of things ... > > I have a Wx::Dialog with report related options and buttons that launch a > Wx::PreviewFrame by means of a Preview button. With the PreviewFrame active > and I have clicked on the Print canvas to be sure, if I push Enter the > default button on the dialog (now hidden and behind the PreviewFrame) is > activated and another preview frame is created, if I press the Escape key > the wxID_CANCEL button is activated and the dialog closes leaving the > PreviewFrame on screen. Has anyone had any experience with this? > > Is there anyway to override the CreateControlBar or Initialize methods? If I > could do this then I could try and look at control focus issues regrading > above problem. I could also create my own ControlBar with improved features. Looking at the C++ code it might not be that simple (the code does not look very flexible). As far as I can see your problem comes from the EVT_CHAR handler of the wxPreviewCanvas. As a workaround you could try to: * call $previewframe->Initialize * use $previewframe->GetChildren and get the wxPreviewCanvas * add an empty EVT_CHAR handler Regards Mattia |
From: Mark W. <ma...@ne...> - 2005-03-14 08:15:38
|
Hi Mattia, I managed to override the EVT_CHAR handler and I seem to be catching "most" of the keypresses, but as experienced in other areas of wxWidgets development I am not seeing Tab, Enter and Escape. Is this another case of using the wxWANTS_CHARS flag? If so, I assume I would need this on the constructor of the canvas? Or could I use it on the creation of the PreviewFrame (I tried but had no success). The only way to try and use this flag on the canvas is to hardwire the wxWidgets source and putting it in prntbase.cpp. Has anyone alse been down this road yet and have any words of advice to offer? Many thanks Mark -----Original Message----- From: Mattia Barbon [mailto:mat...@li...] Sent: 12 March 2005 07:53 PM To: Mark Wardell; 'wxperl-users' Subject: Re: [wxperl-users] Wx::PreviewFrame issues On Fri, 11 Mar 2005 10:22:38 +0200 Mark Wardell <ma...@ne...> wrote: Hello, > I am trying to enhance the printing and previewing side of things ... > > I have a Wx::Dialog with report related options and buttons that > launch a Wx::PreviewFrame by means of a Preview button. With the > PreviewFrame active and I have clicked on the Print canvas to be sure, > if I push Enter the default button on the dialog (now hidden and > behind the PreviewFrame) is activated and another preview frame is > created, if I press the Escape key the wxID_CANCEL button is activated > and the dialog closes leaving the PreviewFrame on screen. Has anyone had any experience with this? > > Is there anyway to override the CreateControlBar or Initialize > methods? If I could do this then I could try and look at control focus > issues regrading above problem. I could also create my own ControlBar with improved features. Looking at the C++ code it might not be that simple (the code does not look very flexible). As far as I can see your problem comes from the EVT_CHAR handler of the wxPreviewCanvas. As a workaround you could try to: * call $previewframe->Initialize * use $previewframe->GetChildren and get the wxPreviewCanvas * add an empty EVT_CHAR handler Regards Mattia |
From: Mark W. <ma...@ne...> - 2005-03-14 11:20:31
|
Hello, I managed to trap the Tab and Enter key presses by doing this but I still miss the ESCAPE key??? I want to override the other methods in the Wx::PreviewFrame class. I tried adding the following lines to the file Preview.xs, but these methods were still not called. I have seen reference to virtual methods is this one of those cases? Can they be overridden? void wxPreviewFrame::Initialize() void wxPreviewFrame::CreateCanvas() void wxPreviewFrame::CreateControlBar() Regards Mark -----Original Message----- From: wxp...@li... [mailto:wxp...@li...] On Behalf Of Mark Wardell Sent: 14 March 2005 10:15 AM To: 'Mattia Barbon'; 'wxperl-users' Subject: RE: [wxperl-users] Wx::PreviewFrame issues Hi Mattia, I managed to override the EVT_CHAR handler and I seem to be catching "most" of the keypresses, but as experienced in other areas of wxWidgets development I am not seeing Tab, Enter and Escape. Is this another case of using the wxWANTS_CHARS flag? If so, I assume I would need this on the constructor of the canvas? Or could I use it on the creation of the PreviewFrame (I tried but had no success). The only way to try and use this flag on the canvas is to hardwire the wxWidgets source and putting it in prntbase.cpp. Has anyone alse been down this road yet and have any words of advice to offer? Many thanks Mark -----Original Message----- From: Mattia Barbon [mailto:mat...@li...] Sent: 12 March 2005 07:53 PM To: Mark Wardell; 'wxperl-users' Subject: Re: [wxperl-users] Wx::PreviewFrame issues On Fri, 11 Mar 2005 10:22:38 +0200 Mark Wardell <ma...@ne...> wrote: Hello, > I am trying to enhance the printing and previewing side of things ... > > I have a Wx::Dialog with report related options and buttons that > launch a Wx::PreviewFrame by means of a Preview button. With the > PreviewFrame active and I have clicked on the Print canvas to be sure, > if I push Enter the default button on the dialog (now hidden and > behind the PreviewFrame) is activated and another preview frame is > created, if I press the Escape key the wxID_CANCEL button is activated > and the dialog closes leaving the PreviewFrame on screen. Has anyone > had any experience with this? > > Is there anyway to override the CreateControlBar or Initialize > methods? If I could do this then I could try and look at control focus > issues regrading above problem. I could also create my own ControlBar > with improved features. Looking at the C++ code it might not be that simple (the code does not look very flexible). As far as I can see your problem comes from the EVT_CHAR handler of the wxPreviewCanvas. As a workaround you could try to: * call $previewframe->Initialize * use $previewframe->GetChildren and get the wxPreviewCanvas * add an empty EVT_CHAR handler Regards Mattia ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ wxperl-users mailing list wxp...@li... https://lists.sourceforge.net/lists/listinfo/wxperl-users |
From: Mike S. <Mik...@Do...> - 2005-03-11 15:17:39
|
mat...@li... wrote: >>I'm guessing that I'll need to run 2 threads, one to update the GUI and >>one to handle the ftp conversation. If (2) is possible, would running >>multi-threaded cause any problems? >> >> > > I do not know if anybody has written a multi threaded >application with wxPerl. I think using two threads is the >best approach. > > We've got wxPerl and POE working nicely together now -- so you can use things like POE::Component::Client::UserAgent -- a non-blocking parallel UA. Just another option. Once our code stabalizes a bit more, we hope to share wxPOE (unless someone has a better name ;) ). |
From: Simon F. <sf...@fl...> - 2005-03-11 15:46:59
|
Mike Schroeder wrote: > mat...@li... wrote: > >>> I'm guessing that I'll need to run 2 threads, one to update the GUI and >>> one to handle the ftp conversation. If (2) is possible, would running >>> multi-threaded cause any problems? >>> >> >> >> I do not know if anybody has written a multi threaded >> application with wxPerl. I think using two threads is the >> best approach. >> >> > We've got wxPerl and POE working nicely together now -- so you can use > things like POE::Component::Client::UserAgent -- a non-blocking parallel > UA. > > Just another option. Once our code stabalizes a bit more, we hope to > share wxPOE (unless someone has a better name ;) ). That'd be great. I tried using POE::Wheel::Wx that you posted last year but hit a bit of an impasse when I couldn't build POE for 5.6.1 on Win32. I'm going to try again, POE would be useful for a personal project I'm working on which doesn't need to run on perl 5.6.1. Simon |
From: Mike S. <Mik...@Do...> - 2005-03-11 16:28:47
Attachments:
wxPOE.tgz
|
Simon Flack wrote: > That'd be great. I tried using POE::Wheel::Wx that you posted last > year but hit a bit of an impasse when I couldn't build POE for 5.6.1 > on Win32. > > I'm going to try again, POE would be useful for a personal project I'm > working on which doesn't need to run on perl 5.6.1. Here is a *rough* little wxPOE sample app that we have used on win32, GTK and OS X. We wanted a wxPerl and POE environment that allowed parallel non-blocking data transactions in the background (using POE::Component::Client::UserAgent) and wxPerl cross-platform GUIs. While were at it, we want a subscribe/publish data model to allow multiple frames to re-use the same data and/or to allow multiple frames to be refreshed when data changed. In our actual application our DataManager (Brain.pm in this example), we do aggressive data caching, avoiding going across the wire for a lot of the calls. In turn, we subclassed a number of wxPerl controls to know how to do their own data calls on instantiation. So when a frame/dialog is instantiated, each control (for example a wxChoice) can go and get its data from the DataManager (which may or may not be using cache) and populate itself asynchronously -- so the user gets more immediate visual feedback. Because we use the parallel user agent, a frame that has 10 controls for example will fire off 10 requests at once (configurable) and populate the controls in parallel. Anyhow, here are some notes from my colleague (Ed Heil) who put this example together... <Ed> It opens a frame, with "URL" and "key" sections, a "request data" button, and a "spawn" button. The "spawn" button makes more frames like itself. Try making a few. (The only difference between them and the original one is that if you close the original one the app goes away.) When you click "request data", it subscribes that frame to a "channel" identified by the current subscription key, and then requests that the data from that URL be brought back on that channel. Try clicking "request data" on the first frame -- it will get data from google.com (Caveat: we don't have redirect handling working in this example, so if you are from another country where google redirects you to a local domain, try some other non-redirecting domain name). Try opening a new frame. Leave the subscription key the same, but change the URL to something else (say, yahoo.com). Click "request data." It will update the data both in the new and the old frame, since they're both subscribed to the same subscription key. Try opening yet another new frame. This time change the subscription key AND the URL. This third frame will update with new data but will leave the others unchanged, because that new data came in on the channel defined by the new subscription key, not the old one to which they are subscribed. Just a proof of concept of the minimum infrastructure we absolutely need to implement publish/subscribe. There are only two POE sessions going on -- the main one tracks the components and subscriptions itself. I implemented some of this functionality by inventing a new class, "Pobject," which is any object of which POE is aware. Viewer.pm is a Pobject as well as a Wx::Frame (multiple inheritance). Pobjects don't even have to be frames -- frames don't have any special status in this publish/subscribe model. Any subclass we create could conceiveably be a Pobject and therefore deal with the Brain (which is the analogue of the DataManager in this demo). |
From: Simon F. <sf...@fl...> - 2005-03-11 17:52:05
|
Mike Schroeder wrote: > Simon Flack wrote: > >> That'd be great. I tried using POE::Wheel::Wx that you posted last >> year but hit a bit of an impasse when I couldn't build POE for 5.6.1 >> on Win32. >> >> I'm going to try again, POE would be useful for a personal project I'm >> working on which doesn't need to run on perl 5.6.1. > > > Here is a *rough* little wxPOE sample app that we have used on win32, > GTK and OS X. We wanted a wxPerl and POE environment that allowed > parallel non-blocking data transactions in the background (using > POE::Component::Client::UserAgent) and wxPerl cross-platform GUIs. > While were at it, we want a subscribe/publish data model to allow > multiple frames to re-use the same data and/or to allow multiple frames > to be refreshed when data changed. That's neat. I can see that I need to approach things differently with POE. I have some reading to do. I'm currently using Class::Publisher for a publish/subscribe events. Originally, I rewrote wxPython's EventManager in perl. But it didn't quite do what I wanted so it's consigned to my CVS attic now. Class::Observable was close, but I wanted more fine-grain control over what events I could subscribe to. [snip] Thanks for the code sample. It gives me something to play with. Simon |
From: Mike S. <Mik...@Do...> - 2005-03-11 18:21:27
|
Simon Flack wrote: > I'm currently using Class::Publisher for a publish/subscribe events. > Originally, I rewrote wxPython's EventManager in perl. But it didn't > quite do what I wanted so it's consigned to my CVS attic now. > Class::Observable was close, but I wanted more fine-grain control over > what events I could subscribe to. Class::Publisher looks great! We will likely try a refactor of wxPOE with it -- thanks! |
From: Mattia B. <mat...@li...> - 2005-03-13 16:10:19
Attachments:
POE-Loop-Wx-0.01.tar.gz
|
On Fri, 11 Mar 2005 09:28:27 -0700 Mike Schroeder <Mik...@Do...> wrote: Hello, > Simon Flack wrote: > > > That'd be great. I tried using POE::Wheel::Wx that you posted last > > year but hit a bit of an impasse when I couldn't build POE for 5.6.1 > > on Win32. > > > > I'm going to try again, POE would be useful for a personal project I'm > > working on which doesn't need to run on perl 5.6.1. > > Here is a rough little wxPOE sample app that we have used on win32, > GTK and OS X. You can find as attachment how this example would look packaged as a CPAN module. Now we need just somebody to upload it to CPAN and maintain it. Nudge, nudge, hint, hint ;-) Regards Mattia |
From: Mike S. <Mik...@Do...> - 2005-03-13 21:10:03
|
Mattia Barbon wrote: > > You can find as attachment how this example would look >packaged as a CPAN module. Now we need just somebody to upload >it to CPAN and maintain it. Nudge, nudge, hint, hint ;-) > ok -- i got the hint -- is this the 3rd time you suggested this? ;-) Give me a few days to sign up on PAUSE. |