Just an FYI...
1) I originally had the -singlesel as the last option in the list (after
-style) and the problem still existed. 
2) When I first started this little project I was running on an older
version of Win32::GUI and it did not generate any depreciation warnings.
It wasn't until I updated to 1.03 that I saw the warnings. The warnings
when generated look like this:
Win32::GUI: the -style option is deprecated! at
C:/Perl/site/lib/Win32/GUI.pm line 603.

It didn't tell me the line of my code that the -style option was
depreciated and since I have a number of places where the -style option
was used (not always in a listview) I wasn't sure which one it was
complaining about.

Thanks again for the help.
Greg

-----Original Message-----
From: Robert May [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 01, 2006 3:05 PM
To: Greg Dance
Cc: perl-win32-gui-users@lists.sourceforge.net
Subject: Re: [win32-gui] [perl-win32-gui-users] -singlesel

Greg Dance wrote:

[snipped to leave some options from Greg's post]

>     -singlesel => 1,
>     -style     => WS_CHILD | WS_VISIBLE | 1,
>     -fullrowselect => 1,
>     -gridlines => 1,
>     -checkboxes => 1,

> What I found is that the -style line is the culprit. When this is 
> included the -singlesel option doesn't do anything. I'm not sure what 
> the -style option is specifically doing, but that is the source of the

> problem.

Several things to learn from this:
(1) Short, complete examples are not just for the benefit of the
audience that you post to;  they often lead to solving (or at least
narrowing down) the problem.
(2) That's probably one of the reasons that the -style option generates
a 'deprecated' warning (you are running with warnings on?)

And for reference, the options that I've left above all do things with
the control's 'style', and are processed in order.  All the options
except '-style', either add or remove style bits from a mask.  '-style' 
clobbers the mask with a fixed value - it's useful if you know what
you're doing, but dangerous (as you've discovered) otherwise.  There are
a number of ways this could be re-written so that it works, the easiest
would be to move the -singlesel option after the -style option - but
note that none of the styles used in the -style line are required by
modern Win32::GUI versions: WS_CHILD and WS_VISIBLE are default options
  for a listview (and most, if not all controls), and I'm not sure what,
if anything, setting bit 0 does.

Glad you've sorted it.

Regards,
Rob.


Reply via email to