[wxPython] NewId

I cannot find any documentation for the function NewId(). From how it
works, my guess is that it combines ::wxNewId() and ::wxRegisterId(). Is
this correct?

I cannot find any documentation for the function NewId(). From how it
works, my guess is that it combines ::wxNewId() and ::wxRegisterId(). Is
this correct?

No, NewId is just a backwards compatibility alias for wxNewId().

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

In that case, does wxNewId() incorporporate the functionality of
wxRegisterId()? This is not clear in the wxWindows docs. I notice that
calling NewId() gives me a new integer each time I call it. Or should I be
calling wxRegisterID() each time I call wxNewId()?

···

----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@lists.wxwindows.org>
Sent: Monday, September 03, 2001 11:31 PM
Subject: Re: [wxPython] NewId

> I cannot find any documentation for the function NewId(). From how it
> works, my guess is that it combines ::wxNewId() and ::wxRegisterId().

Is

> this correct?

No, NewId is just a backwards compatibility alias for wxNewId().

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

In that case, does wxNewId() incorporporate the functionality of
wxRegisterId()? This is not clear in the wxWindows docs. I notice that
calling NewId() gives me a new integer each time I call it. Or should I

be

calling wxRegisterID() each time I call wxNewId()?

static long wxCurrentId = 100;

long wxNewId (void)
{
  return wxCurrentId++;
}

void wxRegisterId (long id)
{
  if (id >= wxCurrentId)
    wxCurrentId = id + 1;
}

wxRegisterId just sets a new point for where the auto generated IDs start
from. If you have a hard coded ID that you want to ensure isn't duplicated
by wxNewId then you call wxRegisterId with it.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!