3

I'm currently writing a GUI program using winform with zedgraph library in ironpython, and I got two problems.

  1. I tried to change the background color of my graph GUI, using

        # Color Fills
    
    self.my_pane.Fill = Fill(Color.Black)
    self.my_pane.Chart.Fill = Fill(Color.Black)
    

    but it turns out, it gives me an error

    Microsoft.Scripting.ArgumentTypeException: expected Fill, got Fill

    but, I have checked the documentation, the type is correct.

  2. When I comment out the above code, and keep running the program, I got another error for the following code

        self.point_list = RollingPointPairList(self.rpl_cap)
        my_curve = self.my_pane.AddCurve("Curve", self.point_list, Color.Yellow, SymbolType.None)
    

    this time it says, expeted a IPointList type, got RollingPointPairList, but RollingPointPairList is a subclass of IPointList. Documentation here for method and here for type

I'm wondering weather if I did something wrong, since when I use the same code to run another GUI program, it works. In both of the program I use

            System.Windows.Forms.Application.EnableVisualStyles()
            System.Windows.Forms.Application.Run(self.graph) 

to start my winform GUI

Does anyone have some idea of what's going on here?

Thanks !

Solution:

So, I created a whole new file, and copy pasted the code line by line, and then it works ... but the origin file still doen't work, I'm confused ..

Update

Ok, it's something wrong with my import, I have add a sys path after import zedGraph module, so, After I move the import after adding sys.path, it works. And the reason why create a new file works is because I import both old and new file when I use it, so it acutally import the zedGarph module

whtitefall
  • 631
  • 9
  • 16

0 Answers0