Wx Issues

BlitzMax Forums/Brucey's Modules/Wx Issues

Pete Rigz(Posted 2013) [#1]
Sorry, me again :)

So TimelineFX is compiling ok however I'm getting one or two errors occurring. The first one in dialog boxes dont seem to be returning string in a friendly way. Here's a sample program that replicates the issue:



Just select any file and see what debuglog throws up, I'm getting:

DebugLog:E\ieieXPrcehpsEpoin\asi.n

Any ideas? Thanks!


Brucey(Posted 2013) [#2]
Apologies. I seem to have introduced a string problem in a recent commit.

It should be working again now.


Pete Rigz(Posted 2013) [#3]
Great thanks Brucey :)


Pete Rigz(Posted 2013) [#4]
I also have an issue with capturing the mouse. If I double click on the canvas window or If I click on another window and the mouse happens to be also over the canvas window it throws an error:

Assert "GetCapture() == this" failed in ReleaseMouse(): attempt to release mouse but this window hasn't captured it.

I recreated int eh glCanvas sample, just try double clicking on the canvas:



Thanks!


Brucey(Posted 2013) [#5]
It's possible that a double click handles differently than a normal click because it is so fast.
To stop the warning, you can use :
If canvas.HasCapture()
   canvas.ReleaseMouse()
End If

or perhaps use HasCapture() elsewhere when you need to be sure it is captured.

I also believe that when you have the mouse down, it is automatically captured for the duration of the time you press the mouse button until you release it. (Can't remember where I read that tho…)


Also, if you are running a timer, you should stop it before you destruct something which it is connected to - or there is a chance the timer will tick, and call against an object (window/etc) which no longer exists. This happens with your above example on OS X ;-)
If it is still live when your window closes, you can always call Stop() on it, just to be on the safe side before your window Destroy() call.


Pete Rigz(Posted 2013) [#6]
Cheers, that seems to have worked :)

Just another quick question about wxListCtrl. I was inserting an item like this:

		item.SetText(name)
		item.SetImage(image)
		item.SetData(shape)
		Self.InsertItem(item)


However that doesn't seem to insert anything anymore. I've had to change it to use InsertImageStringItem, and then use SetItemData separately. I don't think it liked the fact that an index wasn't being set. I tried SetID on the item before inserting it but still nothing happened. InsertImageStringItem seems to be working OK as an alternative so that's fine, just wondering if perhaps there's a bug in there?


Pete Rigz(Posted 2013) [#7]
Actually I just tested again on a different list and using SetId on the item did work so, it does seem ok.. I must have missed something first time round :)