Skip to main content

slidemenu - 3.9

menu.


josmiley / Luke spywoker
(mutualaccount)
a simple sliding menu with tooltips easy to use
see slidemenu.menu.__doc__

see '__main__' for an example

Changes

bugfix

Links

Home Page
http://joel-murielle.perso.sfr.fr/
Source
http://joel-murielle.perso.sfr.fr/slidemenu.zip

Releases

slidemenu 3.0 — 2 Sep, 2011

slidemenu 3.4 — 6 Sep, 2011

slidemenu 3.1 — 2 Sep, 2011

slidemenu 3.2 — 3 Sep, 2011

slidemenu 3.6 — 27 Jan, 2012

slidemenu 3.9 — 26 Apr, 2012

slidemenu 3.11 — 27 Apr, 2012

slidemenu 3.8 — 26 Apr, 2012

slidemenu 3.10 — 26 Apr, 2012

slidemenu 3.7 — 22 Apr, 2012

slidemenu 3.12 — 27 Apr, 2012

slidemenu 3.13 — 30 Apr, 2012

slidemenu 3.14 — 10 Dec, 2012

slidemenu 3.5 — 8 Dec, 2011

slidemenu 3.3 — 4 Sep, 2011

slidemenu 3.15 — 12 Dec, 2012

slidemenu 3.16 — 17 Jul, 2013

Pygame.org account Comments

  • Felix 2011-08-22 12:39

    This is fantastic, however I am not quite sure if I'm allowed use the menu in my own project? Also I found no other way contacting the author besides posting here.

  • josmiley 2011-08-31 15:19

    sure, you can use it ... I would be happy :)

  • Space Max 2012-01-07 19:51

    Salut joe,

    Je n'arrive pas à utiliser ce menu.
    Sous Eclipse :
        g = i.copy()AttributeError: 'Item' object has no attribute 'copy'

    En shell, sous linux idem.

    Je ne suis arrivé à lancer le module que sous Windows avec IDLE (Python GUI)
    Traceback (most recent call last):  File "C:\Users\max\Workspace-eclipse\slidemenu\slidemenu\slidemenu.py", line 143, in <module>    here = dirname(__file__)NameError: name '__file__' is not defined

    La seule façon que j'ai trouvé c'est de le lancer par l'explorateur en double clic !!!!! Elle est où la feinte ....

    Un petit fichier d'aide serait le bienvenu. Sinon, un superbe menu, avec des effets trés agréables.

    very nice as usually 

    josmiley 2012-01-26 22:47

    salut Max,
    le problème name '__file__' is not defined est connu sous IDLE, c'est normal.
    par contre je n'arrive pas à reproduire l'erreur AttributeError: 'Item' object has no attribute 'copy'
    je suis sous linux/python2 et 3
    Item hérite de Rect qui possède bien une méthode copy(), donc je ne comprend pas.

    je cherche et te tiens au courant.

    edit:
    sans conviction, essayes de remplacer la ligne 28 par super(Item,self).__init__(menu)
    et class Item(Rect) par class Item(Rect,object)

    tu peux me contacter sur le chan irc de irc://irc.freenode.org/pygame
    et irc://irc.freenode.org/python-...

  • Space Max 2012-01-28 22:04

    Je viens de retester. C'est Ok.
    a+

  • Vecchio_frac 2012-04-26 11:35

    very nice job, impressive, but... numpy is required? :(

    slidemenu.py:48: RuntimeWarning: use surfarray: no module named numpy or Numeric found
    (ImportError: no module named numpy or Numeric found)
      surfarray.pixels_alpha(shadow)[:] /= 4

    josmiley 2012-04-26 20:59

     pygame.surfarray module is functional when pygame can use the external Numpy or Numeric packages.I added a try/except to correct this problem, but the shadow will be "solid black" if you do not have numpy.

    Vecchio_frac 2012-04-27 11:22

    Thank you Jo.
    The try/except clause don't work properly for me (Windows XP, Python 3.1.4, Pygame 1.9.1)
    Warning (from warnings module):  File "slidemenu.py", line 48    surfarray.pixels_alpha(shadow)[:] /= 4RuntimeWarning: use surfarray: no module named numpy or Numeric found(ImportError: no module named numpy or Numeric found)

    The menu appears regulrly with animation, then everything stops.
    Forgive the insistence, but I wanted to take this wonderful work.
    Excuse my bad English, I do not  speak English so I use Google Translator :)

    josmiley 2012-04-27 16:41

    I also use google translator, I'm French .... ^ ^
    normaly fixed in 3.12

    Vecchio_frac 2012-04-30 10:22

    OK! 3.12 works fine ;) I will use slidemenu :)

    If launched in IDLE:
    Traceback (most recent call last):
      File "slidemenu.py", line 204, in <module>
        here = dirname(__file__)
    NameError: name '__file__' is not defined

    fixed in this manner:
        try:
            here = dirname(__file__)
        except:
            here = '.'

    josmiley 2012-04-30 10:27

    thanks for using slidemenu :)

    the " NameError: name '__file__' is not defined " problem is specific to IDLE.

  • Max Power 2012-04-27 11:17

    Note that the slidemenu will poll all pygame events. I created a patch (http://pastebin.com/ecucK169) that allows you to pass a callback function to the slidemenu, so you can handle the events in your application too (mostly you want to handle EXIT as lest.)

  • Max Power 2012-04-27 11:23

    You should also cache the surfaces you rendered the text on, since font rendering is a very expensive operation in pygame. Here is my Fontrenderer I use in my game Regnancy: http://pastebin.com/r5pmngHk. It will cache all rendered text and also add a shadow to the text (without using numpy). Feel free to use it if you like.

    josmiley 2012-04-27 17:47

    fixed in 3.12
    thanks ;)

  • jer 2012-04-27 19:06

    Can you please post updates less frequently? It's unfair to bump you program over everyone elses and it makes it annoying to re-download

  • SmartViking 2012-12-11 00:37

    What license is this in? If you intend this to be in the public domain, I think you should make a README file specifying it. Just write "This program is released in the public domain" or something like that, it doesn't really matter as long as people can find your intention. If you don't specify it, the software will automatically become subject to copyright. If you want a license (which is a good idea) I recommend the GPL, which will ensure that software utilising this is free software. If you want non-free software to use this, but still want your software to be free software if it were to be redistributed, you can use LGPL. If you basically don't care what people do with it at all, you can use a permissive free software license such as the MIT license.

    josmiley 2012-12-11 09:40

    README file added.

  • Caleb 2013-11-25 15:43

    How does one go about linking things to the menu?