[gnomemm] how to get or check the type of a object???



thanks for ERDI's answer. but i still do not understand.
Can you give me an examples. I must know the type before dynamic_cast, right? How can not know the type of the CanvasItem (CanvasPolygon, CanvasLine,CanvasEllipse ...)? Suppose the get a varible "item" declared as CanvasItem. how can i get or check its type.Maybe isA() or getType is useful. here is my logical code:

if (item is CanvasEllipse)
 do something
else if (item is CanvasPolygon)
 do something different
else
 do other things

Anyone can translate the code to gnomemm code? thanks! I get stuck here

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.microsoft.com/cn




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]