ListBox crash

For questions about using Classic.

Post » Sun Feb 21, 2010 1:20 am

Hi!

Just started to play around a bit with Construct today. One of the biggest reasons for checking it out is the Python integration, seems cool! Anyway, I get this crash when I try to get information from the selected line of a ListBox. This only happens the second time I use it, the first time it works.

i have three objects: A ListBox, a Button and a Text. Here is the code:

[code:3hjllghj]ButtonClicked event
------------------------

Text.Text = ListBox.LineText(ListBox.SelectedLine)[/code:3hjllghj]

Any idea why it crashes the second time I click the button?
B
1
G
2
Posts: 4
Reputation: 633

Post » Sun Feb 21, 2010 1:28 am

Can you post the .cap?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Feb 21, 2010 1:34 am

Is there any way to upload the .cap directly to this forum? Sorry, I am new and haven't read all the forum information yet :oops:
B
1
G
2
Posts: 4
Reputation: 633

Post » Sun Feb 21, 2010 1:35 am

Use a free host or just stick it in the Uploads forum with a link to this thread.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Feb 21, 2010 1:40 am

I uploaded it temporarily to my former band's FTP. Anyway, here it is:

[url:ke15pj3f]http://www.snortingmaradonas.se/erik/miditest.cap[/url:ke15pj3f]

Sometimes I manage to press the button twice (changing the selected text in-between) before the application crashes.
B
1
G
2
Posts: 4
Reputation: 633

Post » Sun Feb 21, 2010 2:45 am

It works if I dont do it in Python code. Creating a sub-event to OnButton Clicked, which the python code above, is what makes the program crash.

Creating an action ( Text: Set text to ListBox.LineText(ListBox.SelectedLine) ) works just fine.
B
1
G
2
Posts: 4
Reputation: 633


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests