Problems With ColourSelect Box Inside A wxDialog
William Wonneberger
wberger at ccil.org
Wed Oct 10 10:26:07 EDT 2001
On Tue, 09 Oct 2001 23:44:32 -0000, Robert Amesz
<reqhye72zux at mailexpire.com> wrote:
Hi, Robert;
Thanks for taking the time to look into this problem.
>> I'm trying to add a wxPython ColourSelect control to a wxDialog box
>> inside a Python script I've been working on. To instantiate the
>> ColourSelect control, I've added the following statement to my
>> Python script;
>>
>> self.colorselect = ColourSelect(self, wxPoint(70, 200), [0, 0,
>> 110], wxDefaultSize)
>
I restored the original version of the ColourSelect.py module, and
called the statement as specified above, and still the ColourSelect
control was not displayed inside the dialog box.
>That isn't much context to work on. There are a number of "psychic
>debuggers" in this ng, but I'm not one of them.
>
>
Sorry 'bout that. The following is the Python class for my dialog
box;
class wxPlotterSettingsDialog(wxDialog):
def __init__(self, parent):
wxDialog.__init__(self, parent, -1, "wxPlotter Settings",
wxDefaultPosition, wxSize(350, 200))
self.static = wxStaticText(self, -1, "Number of points to
draw: ", wxPoint(70, 22))
self.linesSpin = wxSpinCtrl(self, 20, "", wxPoint(200, 20),
wxSize(55, 20))
self.linesSpin.SetRange(1, 360)
self.linesSpin.SetValue(parent.lineCount)
self.static = wxStaticText(self, -1, "Line Color: ",
wxPoint(70, 50))
# self.colorselect = ColourSelect(self, wxPoint(70, 200), [0,
0, 110], wxDefaultSize)
self.colorselect = ColourSelect(self, -1, [0, 0, 110],
wxPoint(70, 200), wxDefaultSize)
self.static = wxStaticText(self, -1, "Background Color: ",
wxPoint(70, 75))
self.static = wxStaticText(self, -1, "Line Ending: ",
wxPoint(70, 102))
self.lineEnding1 = wxRadioButton(self, 25, "Rectangle", (140,
100))
self.lineEnding2 = wxRadioButton(self, 26, "Circle", (215,
100))
self.lineEnding3 = wxRadioButton(self, 27, "None", (270, 100))
self.button = wxButton(self, wxID_OK, " OK ", wxPoint(95,
140), wxDefaultSize).SetDefault()
self.button = wxButton(self, wxID_CANCEL, " Cancel ",
wxPoint(175, 140), wxDefaultSize)
EVT_BUTTON(self, 2001, self.OnOK)
EVT_SPIN(self, 2002, self.OnPointsSpin)
def OnOK(self, event):
self.wnd.Stop()
self.EndModal(wxID_OK)
def OnPointsSpin(self, event):
print "Spin control selected."
def GetLines(self):
return self.linesSpin.GetValue()
def GetLineEnding(self):
print "lineEnding1 = ", self.lineEnding1.GetValue()
print "lineEnding2 = ", self.lineEnding2.GetValue()
print "lineEnding3 = ", self.lineEnding3.GetValue()
return 0
Any other insights you may have on this problem would be greatly
appreciated...
Bill Wonneberger
wberger at ccil.org
More information about the Python-list
mailing list