[Gambas-user] Signal #11 (was Return Code 245 from SDL)
Dominique SIMONART
simonart.dominique at ...11...
Tue Nov 22 00:38:39 CET 2005
Hi everybody,
I think I found the origine of the message! Here is how to produce it:
a GridView on a Form
Form1_Open()
grd1.Rows.Count = 1
grd1.Columns.Count = 1
grd1[0,0].Clear
grd1[0,0].Picture.Load("myPath" &/ "myFile") ' --> signal #11
END
In the real program, I needed to remove the picture in a square of a GridView
and, at the start of a new game, I wanted to restore it. So I used these 2
methodes (Clear and Load). The Clear works indeed, but How to restore the
picture after? May be I don't understand the goal of the Clear method!
About the GridView, I want to add some remarks
1) If a scroll bar is present, then the MouseDown event doesn't always points
you on the rigth square. as an example, if you increment the Text value of a
square each time you click on it, when you click on another square it is
sometimes the first wich is added. WORKAROUND: use the MouseUp event
instead.
2) If a scroll bar is present, and if you scroll the Grid, the Scroll event
AND the MouseUp event are fired. In the preceding example, the last square
will be added during the scroll!!
WORKAROUND: in the Scroll event, post a flag to True and test it in the first
line of the Mouse event. as an example:
PUBLIC ScrollFlag as BOOLEAN
PUBLIC SUB grd1.Scroll_Click()
ScrollFlag = true
...
END
PUBLIC SUB grd1.MouseUp_Click()
if ScrollFlag then
ScrollFlag = FALSE
RETURN
ENDIF
...
END
3) if a scroll bar is present and if you click on the left arrow at the right
of the bar, the scroll event is NOT fired, but the MouseUp event IS, so the
preceding workaround doesn't work in this case. (the bar looks like
| < <|> |
and I talk about the second left arrow)
WORKAROUND: in the MouseUp event, test Mouse.X and/or Mouse.Y
If the cursor is out of the square area, Return.
4) If you want use Text and Picture properties in the same square of a
GridView, you have to Draw it! (Just to say I really need an equivalent of
the MSHFlexgrid of VB!)
I hope this could help somebody
Dominique
More information about the User
mailing list