Hi,
I’m not sure about a custom dialog, It does sound possible.
One way I’d tackle this problem is by using a form instead.
You can use the System.Windows.Forms.Panel class and the System.Drawing.Color class. Here is an example of how you might do this:
import System.Drawing
import System.Windows.Forms
# Create a dictionary that maps colors to their values
color_values = {
System.Drawing.Color.Red: 100,
System.Drawing.Color.Green: 200,
System.Drawing.Color.Blue: 300
}
# Create a panel
panel = System.Windows.Forms.Panel()
# Set the panel's layout to a vertical flow layout
panel.AutoScroll = True
# Iterate over the colors in the dictionary
for color, value in color_values.items():
# Create a label for the color
color_label = System.Windows.Forms.Label()
color_label.BackColor = color
color_label.Text = color.Name
color_label.Width = 100
color_label.Height = 50
# Create a label for the value
value_label = System.Windows.Forms.Label()
value_label.Text = str(value)
value_label.Width = 100
value_label.Height = 50
# Create a panel for the color and value labels
color_value_panel = System.Windows.Forms.Panel()
color_value_panel.Controls.Add(color_label)
color_value_panel.Controls.Add(value_label)
# Add the color-value panel to the main panel
panel.Controls.Add(color_value_panel)
# Display the panel
form = System.Windows.Forms.Form()
form.Controls.Add(panel)
form.Show()
Print "Your nice custom form :)"
Appreciated, I’m not familiar with the API so your suggestion gave me some pointer.
Currently, I’m using Eto.Drawing.Forms (cause its for C#).
For some reason, the label background color doesn’t show.