Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/11/2011, 20:22
Avatar de wilmermorel
wilmermorel
 
Fecha de Ingreso: agosto-2011
Ubicación: Santo Domingo
Mensajes: 30
Antigüedad: 12 años, 8 meses
Puntos: 2
Información Respuesta: Como obtener los colores del sistema en wxPython?

Gracias!
buscando, encontre una manera de como hacerlo por medio de:
wx.SystemSettings_GetColour(color)

Ya que me encargue de recopilar todas las constantes, las paso en un ejemplo para quien les pueda interesar en un futuro.


Código Python:
Ver original
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. import wx
  5.  
  6. SystemColour = (
  7. wx.SYS_COLOUR_SCROLLBAR,
  8. wx.SYS_COLOUR_DESKTOP,
  9. wx.SYS_COLOUR_ACTIVECAPTION,
  10. wx.SYS_COLOUR_INACTIVECAPTION,
  11. wx.SYS_COLOUR_MENU,
  12. wx.SYS_COLOUR_WINDOW,
  13. wx.SYS_COLOUR_WINDOWFRAME,
  14. wx.SYS_COLOUR_MENUTEXT,
  15. wx.SYS_COLOUR_WINDOWTEXT,
  16. wx.SYS_COLOUR_CAPTIONTEXT,
  17. wx.SYS_COLOUR_ACTIVEBORDER,
  18. wx.SYS_COLOUR_INACTIVEBORDER,
  19. wx.SYS_COLOUR_APPWORKSPACE,
  20. wx.SYS_COLOUR_HIGHLIGHT,
  21. wx.SYS_COLOUR_HIGHLIGHTTEXT,
  22. wx.SYS_COLOUR_BTNFACE,
  23. wx.SYS_COLOUR_BTNSHADOW,
  24. wx.SYS_COLOUR_GRAYTEXT,
  25. wx.SYS_COLOUR_BTNTEXT,
  26. wx.SYS_COLOUR_INACTIVECAPTIONTEXT,
  27. wx.SYS_COLOUR_BTNHIGHLIGHT,
  28. wx.SYS_COLOUR_3DDKSHADOW,
  29. wx.SYS_COLOUR_3DLIGHT,
  30. wx.SYS_COLOUR_INFOTEXT,
  31. wx.SYS_COLOUR_INFOBK,
  32. wx.SYS_COLOUR_LISTBOX,
  33. wx.SYS_COLOUR_HOTLIGHT,
  34. wx.SYS_COLOUR_GRADIENTACTIVECAPTION,
  35. wx.SYS_COLOUR_GRADIENTINACTIVECAPTION,
  36. wx.SYS_COLOUR_MENUHILIGHT,
  37. wx.SYS_COLOUR_MENUBAR,
  38. wx.SYS_COLOUR_LISTBOXTEXT,
  39. wx.SYS_COLOUR_BACKGROUND,
  40. wx.SYS_COLOUR_3DFACE,
  41. wx.SYS_COLOUR_3DSHADOW,
  42. wx.SYS_COLOUR_BTNHILIGHT,
  43. wx.SYS_COLOUR_3DHIGHLIGHT,
  44. wx.SYS_COLOUR_3DHILIGHT,
  45. wx.SYS_COLOUR_BTNFACE)
  46.  
  47. app = wx.App(0)
  48. frame = wx.Frame(None, -1, "")
  49. button = wx.Button(frame, -1, "", size=(50, 20))
  50. frame.Show()
  51. for color in SystemColour:
  52.     color_tupla = wx.SystemSettings_GetColour(color)
  53.     color_str   = color_tupla.GetAsString()
  54.     frame.SetTitle(color_str)
  55.     print color_str
  56.     button.SetBackgroundColour(color_tupla)
  57.     button.Update()
  58.     wx.MilliSleep(500)
  59. app.MainLoop()