Re: FW: [perl-win32-gui-users] Website - Code snippets gallery

2004-11-28 Thread Jez White

Hi,


I can put together GUIs...been doing it in Java, Tk,
and using Win32::GUI.  One thing I'd be interested in
would be how to write a Windows app that has a GUI
that responds when you click buttons, but the
underlying activities/background processes continue to
run.


This is doable by using threads - you will probably better of using the 
latest version of Perl (5.8.4?) as you can, since threading is generally 
weak in early versions.  Win32::gui seems fine with threads since I've been 
able to create C threads (via an xs module) which were able to fire events 
in the GUI via windows SendMessages.


Cheers,

jez. 





Re: [perl-win32-gui-users] Forcing focus on a field

2004-11-28 Thread Jez White

I've run into a minor problem, probably just me being dense again...

I have a form that you click on a button to open another form.  When the
second form opens, no field is active until you click on one.  How do you
set a field to be the default field (in the Loft), or how can you force
focus to a field of choice?


Can you use the method SetFocus?

cheers,

jez.





RE: [perl-win32-gui-users] Forcing focus on a field

2004-11-28 Thread Brian Millham
I just found that if you try to use SetFocus in the Activate event, it
doesn't appear to work.  Using SetFocus just before using DoModal for the
window does work.  Any ideas why it doesn't work in the Activate event?

Brian Millham
This message traveled at least 44,000 miles to reach you!
[EMAIL PROTECTED] 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jez
White
Sent: Sunday, November 28, 2004 7:15 AM
To: Brian Millham; perl-win32-gui-users
Subject: Re: [perl-win32-gui-users] Forcing focus on a field

> I've run into a minor problem, probably just me being dense again...
> 
> I have a form that you click on a button to open another form.  When the
> second form opens, no field is active until you click on one.  How do you
> set a field to be the default field (in the Loft), or how can you force
> focus to a field of choice?

Can you use the method SetFocus?

cheers,

jez.




---
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://productguide.itmanagersjournal.com/
___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0448-1, 11/26/2004
Tested on: 11/28/2004 1:56:21 PM
avast! is copyright (c) 2000-2003 ALWIL Software.
http://www.avast.com







Re: FW: [perl-win32-gui-users] Website - Code snippets gallery

2004-11-28 Thread Alex Lee
Thank you all for the support so far! I am currently putting together
an outline and would shortly email those who are interested. The
initial step is to see what we want to put in and just as importantly
-- what we want to leave out! Your input would be greatly appreciated.
Holiday and work is really slowing me down though.


And just to add to Jez's comment on threading- you can also activate
external programs without locking your own program. There are many
ways to do this. You can use Win32::Process for example or you can try
an API call like this:

use Win32::API;
my @API =('none', 'WinEnc', "open", 'selected', 0 ,'current', 1);
my $apiExecute = new Win32::API("Shell32", "ShellExecute",
['P','P','P','P','P','N'], 'N');
$API[3]= "C:\\WINDOWS\\notepad.exe";  ## selected file
$API[5] = "C:\\WINDOWS\\";  ## directory

$apiExecute->Call($API[1],$API[2],$API[3],$API[4],$API[5],10); # execute

Its a little fancy but I feel that its more useful in some ways than
win32::process. For one thing the module is easier to find! The next,
I could be wrong (because win32::process maybe able to do it too), but
I find that this approach can open not just executables but other
files such as text file or and .xls (excel file) and the result would
be that the program will open the app that the extension is linked.

al ;)



[perl-win32-gui-users] Treeview, Toolbar and Imagelist problem. Memory trouble?

2004-11-28 Thread Roelof Bos
Hi,

I have this test application (see attachment) with a toolbar and a
treeview.

The treeview lists the drives an files on my computer.  The toolbar just
contains 10 test buttons with images. The treeview and toolbar
theirselfs seem to work fine. But if I expand an item in the treeview
twice (expand,expand or expand,collapse) the images in the toolbar
dissapear. Not directly, but as soon as I move my mouse cursor over them
the dissapear. OR if i minimize the window and then re-show it all
images are gone. I used images in the treeview as well and here the same
happens. I have tried a lot things but nothing seems to help.

Is this a problem of the GUI::ImageList object? Or a problem of the
Treeview object?

Is there anyone who knows a workaround to keep my images "alive"?

cheers,
Roelof Bos

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.801 / Virus Database: 544 - Release Date: 24-11-2004
 
  


test.pl
Description: Perl program


Re: [perl-win32-gui-users] Treeview, Toolbar and Imagelist problem. Memory trouble?

2004-11-28 Thread Jez White

Hi,

A quick reply - I'll have a proper look tomorrow.

This sounds like a scoping issue. Take the line:

$ExplorerImageList->Add(new Win32::GUI::Bitmap("file_folder.bmp"));

This will add a newly created bitmap to the image list - but the bitmap will 
be "destroyed" by Perl since it thinks the object is not used any longer. 
Having the bitmaps in a global var should solve your problem.


Cheers,

jez.

- Original Message - 
From: "Roelof Bos" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, November 28, 2004 5:04 PM
Subject: [perl-win32-gui-users] Treeview, Toolbar and Imagelist problem. 
Memory trouble?




Hi,

I have this test application (see attachment) with a toolbar and a
treeview.

The treeview lists the drives an files on my computer.  The toolbar just
contains 10 test buttons with images. The treeview and toolbar
theirselfs seem to work fine. But if I expand an item in the treeview
twice (expand,expand or expand,collapse) the images in the toolbar
dissapear. Not directly, but as soon as I move my mouse cursor over them
the dissapear. OR if i minimize the window and then re-show it all
images are gone. I used images in the treeview as well and here the same
happens. I have tried a lot things but nothing seems to help.

Is this a problem of the GUI::ImageList object? Or a problem of the
Treeview object?

Is there anyone who knows a workaround to keep my images "alive"?

cheers,
Roelof Bos

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.801 / Virus Database: 544 - Release Date: 24-11-2004








[perl-win32-gui-users] RE: Treeview, Toolbar and Imagelist problem. Memory trouble?

2004-11-28 Thread Roelof Bos
> A quick reply - I'll have a proper look tomorrow.

Great!

> This sounds like a scoping issue. Take the line:
> 
> $ExplorerImageList->Add(new Win32::GUI::Bitmap("file_folder.bmp"));
> This will add a newly created bitmap to the image list - but 
> the bitmap will 
> be "destroyed" by Perl since it thinks the object is not used 
> any longer. 
> Having the bitmaps in a global var should solve your problem.

Nope, because the ImageList keeps a reference to the bitmap. Besides, we
should be (and we are) able to even write it like this:

$ExplorerImageList->Add("file_folder.bmp");

 Then the Add() method of ImageList will de new Win32::GUI::Bitmap for
us.

I tested both ways and now also as 

my $img = new Win32::GUI::Bitmap("test.bmp");
$Tb1ImageList->Add($img);

($Tb1ImageList is the only ImageList used in the example but you'll see
tomorrow)

But it all doesn't make a difference...

cheers
Roelof Bos

Original message
> > I have this test application (see attachment) with a toolbar and a
> > treeview.
> >
> > The treeview lists the drives an files on my computer.  The 
> toolbar just
> > contains 10 test buttons with images. The treeview and toolbar
> > theirselfs seem to work fine. But if I expand an item in 
> the treeview
> > twice (expand,expand or expand,collapse) the images in the toolbar
> > dissapear. Not directly, but as soon as I move my mouse 
> cursor over them
> > the dissapear. OR if i minimize the window and then re-show it all
> > images are gone. I used images in the treeview as well and 
> here the same
> > happens. I have tried a lot things but nothing seems to help.
> >
> > Is this a problem of the GUI::ImageList object? Or a problem of the
> > Treeview object?
> >
> > Is there anyone who knows a workaround to keep my images "alive"?
> >
> > cheers,
> > Roelof Bos
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.801 / Virus Database: 544 - Release Date: 24-11-2004
> >
> >
> > 
> 




Re: FW: [perl-win32-gui-users] Website - Code snippets gallery

2004-11-28 Thread Harlan Carvey
Jez,

Do you have examples of this?

Thanks,

Harlan

--- Jez White <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> > I can put together GUIs...been doing it in Java,
> Tk,
> > and using Win32::GUI.  One thing I'd be interested
> in
> > would be how to write a Windows app that has a GUI
> > that responds when you click buttons, but the
> > underlying activities/background processes
> continue to
> > run.
> 
> This is doable by using threads - you will probably
> better of using the 
> latest version of Perl (5.8.4?) as you can, since
> threading is generally 
> weak in early versions.  Win32::gui seems fine with
> threads since I've been 
> able to create C threads (via an xs module) which
> were able to fire events 
> in the GUI via windows SendMessages.
> 
> Cheers,
> 
> jez. 
> 
> 


=
--
Harlan Carvey, CISSP
"Windows Forensics and Incident Recovery"
http://www.windows-ir.com
http://groups.yahoo.com/group/windowsir/

"Meddle not in the affairs of dragons, for
you are crunchy, and good with ketchup."

"The simplicity of this game amuses me. 
Bring me your finest meats and cheeses."
--