Foros del Web » Programando para Internet » Python »

como hacer checkable un panel

Estas en el tema de como hacer checkable un panel en el foro de Python en Foros del Web. hola tengo una enorme duda no se como hacer checkable a un panel del wx.aui aver si alguien me puede ayudar @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código python: ...
  #1 (permalink)  
Antiguo 07/03/2009, 12:35
 
Fecha de Ingreso: mayo-2008
Mensajes: 499
Antigüedad: 15 años, 11 meses
Puntos: 1
como hacer checkable un panel

hola tengo una enorme duda no se como hacer checkable a un panel del wx.aui

aver si alguien me puede ayudar

Código python:
Ver original
  1. import wx
  2. import wx.aui
  3. import os
  4.  
  5. ##
  6. ##class panel(wx.Panel):
  7. ##    def __init__(self, parent, id):
  8. ##        wx.Panel.__init__(self, parent, id)
  9. ##
  10. ##        self.SetBackgroundColour("red")
  11. ##        
  12. ##class note(wx.Notebook):
  13. ##    def __init__(self, parent, id):
  14. ##        wx.Notebook.__init__(self, parent, id)
  15. ##
  16. ##        panel = wx.Panel(self)
  17. ##        self.AddPage(panel, "no")
  18. ##
  19. ##
  20. ##
  21. class frame(wx.Frame):
  22.     def __init__(self, parent, id, title):
  23.         wx.Frame.__init__(self, parent, id, title, size=(700, 600))
  24.  
  25.         self.n = 0
  26.         self.x = 0
  27.  
  28.         self.man = wx.aui.AuiManager()
  29.         self.man.SetManagedWindow(self)    
  30.  
  31.         menubar = wx.MenuBar()
  32.         archivo = wx.Menu()
  33.         archivo.Append(10, "&Salir")
  34.  
  35.         ver = wx.Menu()
  36.         self.itool = ver.Append(500, '&Propiedades\tCtrl+U', kind=wx.ITEM_CHECK)
  37.         menubar.Append(archivo, "&Archivo")
  38.         menubar.Append(ver, "&Ver")
  39.         self.SetMenuBar(menubar)
  40.  
  41.        
  42.         self.man.AddPane(self.Create(), wx.aui.AuiPaneInfo().
  43.                           Caption("panel").
  44.                           Float().FloatingPosition(self.GetStartPosition()).Left().Layer(1).
  45.                           CloseButton(True).MaximizeButton(True), wx.aui.AUI_MGR_TRANSPARENT_DRAG)
  46.        
  47.         self.man.AddPane(self.CreatePanel(), wx.aui.AuiPaneInfo().
  48.                           Name("test10").Caption("hello").
  49.                           Bottom().Layer(1).Position(1).CloseButton(True).MaximizeButton(True))
  50.         self.man.Update()
  51.        
  52.         self.man.AddPane(self.CreatePanel(), wx.aui.AuiPaneInfo().Name("text_content").
  53.                           CenterPane().Hide())
  54.        
  55.  
  56.         self.man.GetPane("text_content").Show()
  57.         self.man.Update()
  58.  
  59.         self.CreateStatusBar()
  60.        
  61. ##        self.note = note(self, -1)
  62. ##
  63. ##        self.panel1 = panel(self.note, -1)
  64. ##        self.note.AddPage(self.panel1, "nko")
  65. ##
  66.         self.Bind(wx.EVT_MENU, self.OnCreateText, id=500)
  67.  
  68.         self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnErase)
  69.         self.Bind(wx.EVT_SIZE, self.OnSize)
  70.         self.Bind(wx.aui.EVT_AUI_PANE_CLOSE, self.OnPaneClose)
  71.  
  72.     def Create(self):
  73.         panel = wx.Panel(self, -1)
  74.         panel.SetBackgroundColour('red')
  75.         return panel
  76.  
  77.     def CreatePanel(self):
  78.         text = wx.TextCtrl(self, -1)
  79.         return text
  80. ##
  81.     def OnCreateText(self, event):
  82.         if self.itool.IsChecked():
  83.             self.Create.Show()
  84.         else:
  85.             self.Create.Hide()
  86. ##
  87.     def OnPaneClose(self, event):
  88.         pass
  89.  
  90.     def OnErase(self, event):
  91.         event.Skip()
  92.  
  93.     def OnSize(self, event):
  94.         event.Skip()        
  95.  
  96.  
  97.     def GetStartPosition(self):
  98.  
  99.         self.x = self.x + 20
  100.         x = self.x
  101.         pt = self.ClientToScreen(wx.Point(0, 0))
  102.  
  103.         return wx.Point(pt.x + x, pt.y + x)
  104.        
  105.        
  106. app = wx.App()
  107. frame(None, -1, "tr").Show()
  108. app.MainLoop()
ya busque hacerlo tambien con una pagina de un notebook pero no puedo hacerlo
saludos!!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:43.