Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5973689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:50:08+00:00 2026-05-22T20:50:08+00:00

class iFrame(wx.Frame): def __init__(blah blah blah): wx.Frame.__init.__(blah blah blah) self.panel = wx.Panel(self, -1) self.panel.SetBackgroundColour((I

  • 0
class iFrame(wx.Frame):
    def __init__(blah blah blah):  
        wx.Frame.__init.__(blah blah blah)  

        self.panel = wx.Panel(self, -1)  
        self.panel.SetBackgroundColour((I put a random RGB here for test purposes))  

        c_color = wx.Button(self.panel, -1, 'Press To Change Color')  
        c_color.Bind(wx.EVT_BUTTON, self.OnCC)  

    def OnCC(self, evt):
        dlg = wx.ColourDialog().SetChooseFull(1)  
        if dlg.ShowModal() == wx.ID_OK:  
            data = dlg.GetColourData()  
            color = data.Colour  
            print (color) # I did this just to test it was returning a RGB
            self.panel.SetBackgroundColour(color)  
        dlg.Destroy()  

What I’ve tried to do was link a button to a color dialog, store the RGB in a variable and use it to set the panel’s background color…I’ve tested almost all of this, I’ve inserted the returned RGB directly into the self.panel itself and it works, so why doesn’t it work when I use it within this method

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:50:09+00:00Added an answer on May 22, 2026 at 8:50 pm

    The line dlg = wx.ColourDialog().SetChooseFull(1) seems like a bug — isn’t SetChooseFull a method on wx.ColourData?

    I made a few changes to get it working and commented the code to illustrate:

    def OnCC(self, evt):
        data = wx.ColourData()
        data.SetChooseFull(True)
    
        # set the first custom color (index 0)
        data.SetCustomColour(0, (255, 170, 128))
        # set indexes 1-N here if you like.
    
        # set the default color in the chooser
        data.SetColour(wx.Colour(128, 255, 170))
    
        # construct the chooser
        dlg = wx.ColourDialog(self, data)
    
        if dlg.ShowModal() == wx.ID_OK:
            # set the panel background color
            color = dlg.GetColourData().Colour
            self.panel.SetBackgroundColour(color)
        dlg.Destroy()
    

    The data.SetCustomColor(index, color) populates the N custom colors in the dialog. I’ve circled the one at index 0 below:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you put an iframe inside a div : <div id=big-box> <iframe src=http://www.google.com class=frame>
<div id=DateAndTime style=clear:left; width:100% class=Frame> <h2>Date & Time Criteria</h2> <h3>Permitted Days of the Week</h3>
I want to open a modalpopup in frame.I pasted here my frame's htlm code
I have <iframe src=correctdata.php frameborder=0 width=100% height=330 id=correctdata></iframe> <div class=floatright><a class=button bigger onclick=window.frames['correctdata'].document.form['correct'].submit();>Submit</a></div> And
I have a frame on which i have created a main panel. On that
I'm trying to use jQuery to test for a css class applied to an
<form method=post target=take_the_reload> ... </form> <iframe class=hide_me name=take_the_reload></iframe> My issue is as follows: I
I have this HTML: <div class=frame id=play> <img src=images/click.png alt=facebook> </div> <div class=frame id=maru>
class Foo { static bool Bar(Stream^ stream); }; class FooWrapper { bool Bar(LPCWSTR szUnicodeString)
class Tag(models.Model): name = models.CharField(maxlength=100) class Blog(models.Model): name = models.CharField(maxlength=100) tags = models.ManyToManyField(Tag) Simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.