Forum: wxRuby number for id

2aa32559134aa3d596fb749f8ffccde7?d=identicon&s=25 hendra kusuma (Guest)
on 2010-03-22 02:53
(Received via mailing list)
what number is safe to be used for Id?
you see, most of time I use -1 for id which means id is generated
automatically
also there is some fixed id like id for about dialog, or else
but sometimes we need the id number, like when we create shortcut for
menu
item

So, what range of number is safe? I see the docs and some of them use
number
> 100
is that ok?
what number is forbidden?

Regards
Hendra
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2010-03-23 21:41
(Received via mailing list)
On 22/03/2010 01:52, hendra kusuma wrote:
> what number is safe to be used for Id?
> you see, most of time I use -1 for id which means id is generated
> automatically
> also there is some fixed id like id for about dialog, or else
> but sometimes we need the id number, like when we create shortcut for
> menu item

Any value < 65336 is permitted, in theory. Use Wx::ID_ANY / -1 wherever
possible, but otherwise I think values > 3,000 are almost all open for
user use. Some classes (eg Wx::Event) also have methods to give
unreserved ids.

alex
This topic is locked and can not be replied to.