1. Strange ListView Behavior

When I 

setLVItemText(ListView89,2,2,"***") 

into an empty ListView. Nothing happens.

However if  I 

for x=1 to getLVCount(ListView89) do 
                       junk&=addLVItem(ListView89,0,"")
              end for

First

then it works ok.

Don Cole

new topic     » topic index » view message » categorize

2. Re: Strange ListView Behavior

don cole wrote:
> 
> When I 
> 
> setLVItemText(ListView89,2,2,"***") 
> 
> into an empty ListView. Nothing happens.


Let me get this straight ... you are trying to change the text of a non-existant
item and you're surprised that it doesn't do anything.


> However if  I 
> 
> for x=1 to getLVCount(ListView89) do 
>                        junk&=addLVItem(ListView89,0,"")
>               end for
> 
> First
> 
> then it works ok.

Then you add some stuff and now changing items works ... 

Yep, that is weird.


-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

3. Re: Strange ListView Behavior

don cole wrote:
> 
> When I 
> 
> setLVItemText(ListView89,2,2,"***") 
> 
> into an empty ListView. Nothing happens.
> 
> However if  I 
> 
> for x=1 to getLVCount(ListView89) do 
>                        junk&=addLVItem(ListView89,0,"")
>               end for
> 
> First
> 
> then it works ok.
> 
> Don Cole

I'd expect that.
setLVItem() sets an item's properties. The item must exist prior.
If you add it first, then it exists and can be set.
I jnow, some routine sets, like defineUserProperties() and friends, weren't
designed like this. But I think this behaviour should remain the exception. add()
adds and sets somehow, set() only sets.

The release of win32lib 0.70.4a will be delayed a little due to the current
development activity for Eu v4.0. I'm now targetting June 15 or something around
that date.

CChris

new topic     » goto parent     » topic index » view message » categorize

4. Re: Strange ListView Behavior

Derek Parnell wrote:
> 
> don cole wrote:
> > 
> > When I 
> > 
> > setLVItemText(ListView89,2,2,"***") 
> > 
> > into an empty ListView. Nothing happens.
> 
> 
> Let me get this straight ... you are trying to change the text of a
> non-existant
> item and you're surprised that it doesn't do anything.
> 
> 
> > However if  I 
> > 
> > for x=1 to getLVCount(ListView89) do 
> >                        junk&=addLVItem(ListView89,0,"")
> >               end for
> > 
> > First
> > 
> > then it works ok.
> 
> Then you add some stuff and now changing items works ... 
> 
> Yep, that is weird.
> 
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> Skype name: derek.j.parnell

Of course I start out with,

global constant ListView89 = createEx( ListView, {"ListView89"," "," "," "," ","
"," "," "},
Window1, 4, 4, 776, 148,
                w32or_all({LVS_REPORT,LVS_SHOWSELALWAYS}), 0 )

Don Cole

new topic     » goto parent     » topic index » view message » categorize

5. Re: Strange ListView Behavior

CChris wrote:
> 
> don cole wrote:
> > 
> > When I 
> > 
> > setLVItemText(ListView89,2,2,"***") 
> > 
> > into an empty ListView. Nothing happens.
> > 
> > However if  I 
> > 
> > for x=1 to getLVCount(ListView89) do 
> >                        junk&=addLVItem(ListView89,0,"")
> >               end for
> > 
> > First
> > 
> > then it works ok.
> > 
> > Don Cole
> 
> I'd expect that.
> setLVItem() sets an item's properties. The item must exist prior.
> If you add it first, then it exists and can be set.
> I jnow, some routine sets, like defineUserProperties() and friends, weren't
> designed like this. But I think this behaviour should remain the exception.
> add() adds and sets somehow, set() only sets.
> 
> The release of win32lib 0.70.4a will be delayed a little due to the current
> development activity for Eu v4.0. I'm now targetting June 15 or something
> around
> that date.
> 
> CChris

Thanks CChris,

  I'll just keep doing it the same way. Not really a problem but weird.

Don Cole

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu