Sign in to follow this  
Followers 0
Zaxon

list boxes not updateable?

3 posts in this topic

#1 ·  Posted (edited)

I'm finding that if I create a list view, then create a new gui window to do something, close the newly created window taking you back to the original gui, that I can't update the list view. Need an example?

Consider the following sample code:

; create main window

GUICreate ("title")

$id=GUICtrlCreateListView ("list",5,5)

GUICtrlCreateListViewItem("test",$id)

GUISetState()

GUICtrlCreateListViewItem("I'm added",$id)

sleep(5000)

Produces a simple list box. Note the second list entry - I'm added.

Look at the same code, but this time we'll open a new gui window, close it, and then try added the second line.

; create main window

GUICreate ("title")

$id=GUICtrlCreateListView ("list",5,5)

GUICtrlCreateListViewItem("test",$id)

GUISetState()

; create secondary window

$h=GUICreate ("title")

GUISetState()

sleep(1000)

guidelete($h)

; back to main window

GUICtrlCreateListViewItem("I'm added",$id)

sleep(5000)

What's happening here? What causes the original list view, which I have the id for, to not be extendible?

Edited by Zaxon

Share this post


Link to post
Share on other sites



I'm finding that if I create a list view, then create a new gui window to do something, close the newly created window taking you back to the original gui, that I can't update the list view.  Need an example?

Consider the following sample code:

; create main window

GUICreate ("title")

$id=GUICtrlCreateListView ("list",5,5)

GUICtrlCreateListViewItem("test",$id)

GUISetState()

GUICtrlCreateListViewItem("I'm added",$id)

sleep(5000)

Produces a simple list box.  Note the second list entry - I'm added.

Look at the same code, but this time we'll open a new gui window, close it, and then try added the second line.

; create main window

GUICreate ("title")

$id=GUICtrlCreateListView ("list",5,5)

GUICtrlCreateListViewItem("test",$id)

GUISetState()

; create secondary window

$h=GUICreate ("title")

GUISetState()

sleep(1000)

guidelete($h)

; back to main window

GUICtrlCreateListViewItem("I'm added",$id)

sleep(5000)

What's happening here?  What causes the original list view, which I have the id for, to not be extendible?

<{POST_SNAPBACK}>

in my mind there is no reason why a GuiSwitch($main) would be needed before calling for addition but the following solve your problem. I have a look this weekend why :lmao:

; create main window
$main=GUICreate ("title")
$id=GUICtrlCreateListView ("list",5,5)
GUICtrlCreateListViewItem("test",$id)
GUISetState()

; create secondary window
$h=GUICreate ("title")
GUISetState()
sleep(1000)
guidelete($h)

GuiSwitch($main)

; back to main window
GUICtrlCreateListViewItem("I'm added",$id)
sleep(5000)

Share this post


Link to post
Share on other sites

in my mind there is no reason why a GuiSwitch($main) would be needed before calling for addition but the following solve your problem.

<{POST_SNAPBACK}>

Agreed.

Your solution works! Thanks for that, jpm

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0