Hi everyone,
I'm a newbie to python programming. I took my first steps to Python
GUI Programming and is currently familiarizing with wxPython. I've
read many program codes and found IDs like wx.EVT_MENU, wx.ID_EXIT
etc. I didn't understand what are those. So as usual, i googled it and
found that they are IDs... Is there a complete list of such IDs and a
description (or use) about them?.
Like
wx.ID_EXIT - to exit the program
Can anyone please help me?
Balasankar C
c.balasankar@gmail.com
for a complete list:
for i in dir(wx):
if i.startswith("ID"):
print i
There are a LOT!, and that doesn't give you an idea what they are used for.
But I think you are looking at this backwards -- you should start with
a use-case, and find the ID you need from there, and they are usually
documented near where they might be used.
Also: IDs are a bit of a wart in wx -- legacy from teh underlying C++
lib, and not bvery Pytoninc, so in general, you dont need to use them.
The exception to this is if you want wo to handle something in a
standard cross-platfomr manner. By using a standard ID, wx can do
somethign different under teh hood.
For more on all this, see:
http://wiki.wxpython.org/wxPython%20Style%20Guide
and
http://wiki.wxpython.org/Optimizing%20for%20Mac%20OS%20X
(even if you think you don't want to support the Mac -- that page
gives some good hints about X-platform stuff)
HTH,
-Chris
···
On Fri, Sep 21, 2012 at 5:29 AM, Balasankarc <c.balasankar@gmail.com> wrote:
Hi everyone,
I'm a newbie to python programming. I took my first steps to Python
GUI Programming and is currently familiarizing with wxPython. I've
read many program codes and found IDs like wx.EVT_MENU, wx.ID_EXIT
etc. I didn't understand what are those. So as usual, i googled it and
found that they are IDs... Is there a complete list of such IDs
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
Hi everyone,
I'm a newbie to python programming. I took my first steps to Python
GUI Programming and is currently familiarizing with wxPython. I've
read many program codes and found IDs like wx.EVT_MENU, wx.ID_EXIT
etc. I didn't understand what are those. So as usual, i googled it and
found that they are IDs... Is there a complete list of such IDs and a
description (or use) about them?.
Like
wx.ID_EXIT - to exit the program
Can anyone please help me?
Balasankar C
c.balasankar@gmail.com
If you look in the wx help, in the wx Documents & Demo package, for
wxStandardID then you will get a full list, of the predefined IDs, you
should also look at the "Stock Items" list, you can also try the
following at a python prompt.
import wx
for item in dir(wx):
... if item.startswith('ID_'): # or 'ETV_'
... print item,
...
This will give you a list of all the names that fit the pattern.
Gadget/Steve
···
On 21/09/2012 1:29 PM, Balasankarc wrote:
Balasankarc wrote:
I'm a newbie to python programming. I took my first steps to Python
GUI Programming and is currently familiarizing with wxPython. I've
read many program codes and found IDs like wx.EVT_MENU, wx.ID_EXIT
etc. I didn't understand what are those.
The question is a little awkward, in part because wx.EVT_MENU is a very
different kind of thing than wx.ID_EXIT. wx.EVT_MENU, like all of the
things that start with EVT_, is an event object, used when you need to
have a function called in response to an event. wx.ID_EXIT, like all of
the things that start with ID_, is just a number (5006) that can be used
to identify the windows and menu items you add to your application, so
you can tell them apart.
The ID thing is a leftover from the underlying operating systems. When
you create a dialog in Windows, each item in the dialog has an ID
number All of the messages from the item includes the ID number. In
wxPython, you can usually omit those, because there are better ways to
do it.
So as usual, i googled it and
found that they are IDs... Is there a complete list of such IDs and a
description (or use) about them?.
Like
wx.ID_EXIT - to exit the program
Can anyone please help me?
Chris is right. You don't start from that end. Instead, you start by
asking yourself what it is you need to do. Then, you find out what is
available to help you achieve that goal.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.