[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] deiconify method?



Just to follow up -- just *after* emailing the list, I went and looked
at the SDL sources directly and noticed the asymmetry noted by Brian.
There are SDL_ShowWindow(win)and SDL_HideWindow(win) fn's which could
work, but they're not wrapped and I ran into some problems trying to
quickly test them via ctypes.

For now, I settled on something hacky like set_mode((1,1)), which
effectively hides the window (it's a frameless window positioned
in a corner).

Thanks,
/jamie



On 07/01/11 18:59, Brian Fisher wrote:
You're not missing anything obvious. There is no method to de-iconify,
because the underlying SDL library had no method to de-iconify.

I think the reason for that may be that there weren't programmatic
de-iconify methods on all platforms - the operating system window
managers usually don't want apps to be able to activate themselves and
steal focus, because it's generally considered bad form and annoying to
the user if apps do that.

You might be able to get this going with ctypes calling platform
specific stuff withyour window handle from the
pygame.display.get_wm_info() function

I think windows has a deiconify call (ShowWindow with the correct SW_
flag), but I think it only works if your window is already active,
otherwise it makes your bar blink blue or something - basically it just
lets you politely ask to be un-minimized - the user must be the one to
actually un-minimize the app.


On Fri, Jul 1, 2011 at 2:20 PM, James Mazer <james.mazer@xxxxxxxx
<mailto:james.mazer@xxxxxxxx>> wrote:

    I think I must be missing something obvious, but years of pygame
    programming and an hour of googling and I still can't figure out
    the inverse of pygame.display.iconify()...

    Is there a way to *deiconify* the pygame window without doing
    something ugly like calling quit() and set_mode() again?

    Thanks,
    /jamie

    --
    James Mazer
    Department of Neurobiology
    Yale School of Medicine
    phone: 203-737-5853 <tel:203-737-5853>
    fax: 203-785-5263 <tel:203-785-5263>



--
James Mazer
Department of Neurobiology
Yale School of Medicine
phone: 203-737-5853
fax: 203-785-5263