Prisijungti

wxCubeColourDialog paleidimas

TechtronicMindaugas N.
  • 23 Rugs '11

Gal galit kas padeti paleisti CubeColourDialog ?
http://xoomer.virgilio.it/infinity77/ma ... ialog.html

  • 24 Rugs '11

Pagal dokumentaciją: http://xoomer.virgilio.it/infinity77/AGW_Docs/_modules/cubecolourdialog.html

#!/usr/bin/env python
import wx
import wx.lib.agw.cubecolourdialog as CCD

# Our normal wxApp-derived class, as usual
app = wx.App(0)

colourData = wx.ColourData()
dlg = CCD.CubeColourDialog(None, colourData)


if dlg.ShowModal() == wx.ID_OK:

# If the user selected OK, then the dialog's wx.ColourData will
# contain valid information. Fetch the data ...
    colourData = dlg.GetColourData()
    h, s, v, a = dlg.GetHSVAColour()

# ... then do something with it. The actual colour data will be
# returned as a three-tuple (r, g, b) in this particular case.
    colour = colourData.GetColour()
    r, g, b, alpha = colour.Red(), colour.Green(), colour.Blue(), colour.Alpha()
    print "You selected (RGBA): %d, %d, %d, %d"%(r, g, b, alpha)
    print "You selected (HSVA): %d, %d, %d, %d"%(h, s, v, a)

# Once the dialog is destroyed, Mr. wx.ColourData is no longer your
# friend. Don't use it again!
dlg.Destroy()

app.MainLoop()
TechtronicMindaugas N.
  • 24 Rugs '11

Aciu.

Atsakyti