jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 68 forks source link

drawing inside form using turtle built-in module[request] #525

Closed muhammad-al-baqir-khalid closed 6 years ago

muhammad-al-baqir-khalid commented 6 years ago

I'm using turtle built-in module to make a circle but it's using another window. I would like to drawing it inside the same form that appJar use. about turtle built-in module: The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. https://docs.python.org/3.7/library/turtle.html

jarvisteach commented 6 years ago

Could you add some sample code?

muhammad-al-baqir-khalid commented 6 years ago

import turtle as draw from appJar import gui

app = gui('Draw') drawing = draw.Turtle() drawing.circle(30) app.go() draw.done()

if you close one of the forms u will get an error.

muhammad-al-baqir-khalid commented 6 years ago

Traceback (most recent call last): File "C:\Users\PC\Desktop\Learning\eiu.py", line 9, in draw.done() File "", line 8, in mainloop File "C:\Users\PC\AppData\Local\Programs\Thonny\lib\turtle.py", line 813, in mainloop TK.mainloop() File "C:\Users\PC\AppData\Local\Programs\Thonny\lib\tkinter__init__.py", line 557, in mainloop _default_root.tk.mainloop(n) AttributeError: 'NoneType' object has no attribute 'tk'

jarvisteach commented 6 years ago

Ah, OK, I see.

Have you seen this: http://appjar.info/outputWidgets/#turtle

muhammad-al-baqir-khalid commented 6 years ago

Nice work it's worked :D