PyGame window inside PyUI?

2002-05-04
2002-05-09
  • Steven M. Castellotti

    Hey all-

       I have a Python application which consists of a few basic widgets (like
    edit and graphic buttons), and would like to use an SDL window for graphic
    output, managed through PyGame. I want everything inside of the same
    application window, and I'm hoping to use PyUI for the widgets.

       Since I don't really want to use frames which can be closed, I'm
    current creating a frame that starts at coordinates -5, -20 (to hide the
    titlebar and close button) and is the same size as my window in pyui.init.
    I fill my Frame with individual panels, which hold the widgets.

       This all works fine, but in one of the panels I'd like to have a PyGame
    window, for my graphic output. Is there a simple way to do this?

    Cheers,

    Steve Castellotti
    SteveC@innocent.com
    http://cogengine.sourceforge.net/

     
    • Sean Riley

      Sean Riley - 2002-05-09

      you can use a Window instead of a Frame  if you dont want borders on your frame. You can also override onCloseButton() on Frame to change the behaviour of the close button.

      if you are using the 2D Pygame renderer, the windows are have access to pygame drawing calls.. you should be able to put pugame drawing calls in the draw() method of a pyui Panel derived class of your own.

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks