Results 1 to 6 of 6

Thread: [SOLVED] wxPython "close" menu item icon

  1. #1
    Join Date
    Apr 2008
    Beans
    129
    Distro
    Ubuntu 8.04 Hardy Heron

    [SOLVED] wxPython "close" menu item icon

    Currently learning the ins-and-outs of wxPython. I've run into a little problem and I can't find any docs about it: using wxPython, how can I make a "close" menu item which uses whatever icon the theme is supposed to?

    Code:
    file = wx.Menu()
    file.Append(11, '&Close\tCtrl+W')
    I'm sure there is something built in to wxWidgets, but I can't find it. Thanks for any help

  2. #2
    Join Date
    Feb 2008
    Beans
    785
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: wxPython "close" menu item icon

    well , I use wxwidgets in C++ , but I guess the concept is quite the same.
    append to the wxmenu , a wxmenu item , which you then you set its icon with wxMenuItem::SetBitmap :
    http://docs.wxwidgets.org/stable/wx_...uitemsetbitmap

    I never used that function , I like my menu items without any graphics. (-:

  3. #3
    Join Date
    Apr 2008
    Beans
    129
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: wxPython "close" menu item icon

    Thanks, but what if, for example, the user has set their environment to use a specific icon theme? How can I use whatever that theme says I should use as the "close" icon? I feel like there's some standard way to do it that I'm missing.

  4. #4
    Join Date
    Apr 2008
    Beans
    129
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: wxPython "close" menu item icon

    (bump)

  5. #5
    Join Date
    Apr 2008
    Beans
    129
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: wxPython "close" menu item icon

    Got it, it's
    Code:
    file.Append(wx.ID_EXIT, '&Close\tCtrl+W')
    which makes sense, but I couldn't find any documentation on it so I did a search on google code...

  6. #6
    Join Date
    Feb 2008
    Beans
    785
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: [SOLVED] wxPython "close" menu item icon

    I think its not what I meant to do in the first place.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •