I want to make a scrollable canvas in an GUI written by wxPython, and I want
to draw some basic shapes on canvas, which are the elements of flow chart.
Yeah , I'm going to realize a function to draw flow charts.
Now, I know I can use floatCanvas and plotCanvas, but which one is better
and easier to use? I'm a beginer of wxpython. So I need some advice for my
problem.
I want to make a scrollable canvas in an GUI written by wxPython, and I want
to draw some basic shapes on canvas, which are the elements of flow chart.
Yeah , I'm going to realize a function to draw flow charts.
Now, I know I can use floatCanvas and plotCanvas, but which one is better
and easier to use? I'm a beginer of wxpython. So I need some advice for my
problem.
Welcome!
First, plotCanvas is very old (>7 yrs?) and long-deprecated, as I
understand it. From the Demo:
"PyPlot is an improvement over wxPlotCanvas, which is now deprecated.
If you are using wxPlotCanvas now, please make plans to migrate in
anticipation of the time that wxPlotCanvas disappears completely."
Also, both are for plotting, as in x/y graphs. (Mike, I think you may
have skimmed this post a little too quickly? :D)
So, FloatCanvas would be what you need, I think.
Che
···
On Sat, Apr 20, 2013 at 4:55 AM, Gabrielle <xuan901031@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I want to make a scrollable canvas in an GUI written by wxPython, and I want
to draw some basic shapes on canvas, which are the elements of flow chart.
Yeah , I'm going to realize a function to draw flow charts.
Now, I know I can use floatCanvas and plotCanvas, but which one is better
and easier to use? I'm a beginer of wxpython. So I need some advice for my
problem.
I think you are comparing apples and oranges, FloatCanvas and PlotCanvas are not really the same thing. Perhaps you meant FloatCanvas and OGL? Either way, I think I would probably use FloatCanvas for flow charts in new development. OGL has had only slight maintenance for a long while now.
I found another thing, that is wx.lib.ogl, it can also draw something on canvas. Do you know what’s the difference between wx.lib.ogl and wx.lib.floatcanvas? Because I found there are many ways to draw in wxPython, but I don’t know which is better for me.
···
On Tuesday, April 23, 2013 4:28:12 AM UTC+8, Che M wrote:
Actually, I’m not familiar with those packages. There is wx.lib.ogl, it related to OGL. But I just wonder, all those packages can help me to draw, which one is the best?
Now, I find that DeviceContext can be used to draw things, so I can use drawing method directly without using wx.lib.floatcanvas or some packages like this. Am I right?
I’m a freshman to program, and I need help of you. What I’m developing is an application that is really in tough, maybe I will ask more in the next.
Thanks again!
BTW, I learned some demos in your GitHub, it’s really helpful
···
On Tuesday, April 23, 2013 8:23:21 AM UTC+8, Robin Dunn wrote:
Gabrielle wrote:
I want to make a scrollable canvas in an GUI written by wxPython, and I want
to draw some basic shapes on canvas, which are the elements of flow chart.
Yeah , I’m going to realize a function to draw flow charts.
Now, I know I can use floatCanvas and plotCanvas, but which one is better
and easier to use? I’m a beginer of wxpython. So I need some advice for my
problem.
I think you are comparing apples and oranges, FloatCanvas and PlotCanvas
are not really the same thing. Perhaps you meant FloatCanvas and OGL?
Either way, I think I would probably use FloatCanvas for flow charts in
new development. OGL has had only slight maintenance for a long while now.
Oops…you’re right, Che. I saw the word “plot” and assumed the OP wanted to know about plotting in wxPython. For some reason, I don’t think of float canvas as a plotting widget.
Mike
···
On Monday, April 22, 2013 3:28:12 PM UTC-5, Che M wrote:
Thanks~~
Actually, I'm not familiar with those packages. There is wx.lib.ogl, it
related to OGL. But I just wonder, all those packages can help me to
draw, which one is the best?
Try them out and see what best fits your needs and abilities.
Now, I find that DeviceContext can be used to draw things,
There is also wx.GraphicsContext. And Cairo can be used from wxPython as well.
so I can use
drawing method directly without using wx.lib.floatcanvas or some
packages like this. Am I right?
Yes, but it is a much lower level API. All it can do is draw, it does not keep track of drawn objects, is not able to manipulate those objects and/or the whole view and automatically redraw, interact with mouse events, etc. You would need to do all of that yourself if you use a lower-level API like wx.DC or wx.GraphicsContext. Higher level APIs like FloatCanvas take care of those kinds of things for you.
Thank for your reply, now I know their difference more clear.
By the way, do you know pygame? I think pygame can drawing things easier.
For now, I want to realize a software that can draw things like the link
shows: https://www.lucidchart.com/documents/edit/4708-145c-517714d1-a330-71940a005abb#?demo=on
The blocks can be dragged into canvas, and we can text in block, resize the
bolck. Draw lines to connect blocks, if the connected block moves, the
connection line also move with this block.
Now I have pygame and wx.lib.floatcanvas as choice. Although pygame is much
better for game, it's methods are clear and easy to use I think. What's
more, I don't know whether wx.lib.floatcanvas can realize the drawing
function that I wanted. Pygame seems easier than Floatcanvas to draw things.
Thank for your reply, now I know their difference more clear.
By the way, do you know pygame? I think pygame can drawing things easier.
For now, I want to realize a software that can draw things like the link
shows: Lucid visual collaboration suite: Log in
The blocks can be dragged into canvas, and we can text in block, resize the
bolck. Draw lines to connect blocks, if the connected block moves, the
connection line also move with this block.
Now I have pygame and wx.lib.floatcanvas as choice. Although pygame is much
better for game, it's methods are clear and easy to use I think. What's
more, I don't know whether wx.lib.floatcanvas can realize the drawing
function that I wanted. Pygame seems easier than Floatcanvas to draw things.
Can you give me some advice about this?
The best advice I can give is to test them both with a small example of something like what you would want to do in your main project and see which one works better for you.
On Tue, Apr 23, 2013 at 10:53 PM, Gabrielle <xuan901031@gmail.com> wrote:
By the way, do you know pygame? I think pygame can drawing things easier.
For now, I want to realize a software that can draw things like the link
shows:
Lucid visual collaboration suite: Log in
The blocks can be dragged into canvas, and we can text in block, resize the
bolck. Draw lines to connect blocks, if the connected block moves, the
connection line also move with this block.
Now I have pygame and wx.lib.floatcanvas as choice. Although pygame is much
better for game, it's methods are clear and easy to use I think.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Thanks for your advice.
I considered floatcanvas at first, but its canvas didn't seem good for me.
Then I chose ogl.
I will ask you realated questions if I'm going to use floatcanvas.