Akuli / tkinter-tutorial

Tkinter tutorial for beginners.
Other
122 stars 25 forks source link

Visualize button is not working #1

Closed niranjanreddy891 closed 6 years ago

niranjanreddy891 commented 6 years ago
import tkinter as tk
from tkinter.filedialog import askopenfilename

    visual = pcl.pcl_visualization.CloudViewing()

    # filtering ground points
    print(cloud.size)

    fil = cloud.make_passthrough_filter()
    fil.set_filter_field_name("z")
    fil.set_filter_limits(0, 1.5)
    cloud_filtered = fil.filter()

    print(cloud_filtered.size)

###### visualization
    visual.ShowColorCloud(cloud, b'cloud')

    flag = True
    while flag:
        flag != visual.WasStopped()
    end

root.mainloop()
Akuli commented 6 years ago

There's one thing that always works when debugging stuff... make a copy of the code, remove some feature, try to run the code and keep going until you find the problem. Now your code contains lots of stuff that has nothing to do with whatever your actual problem is. It could be worse, but I'm sure you can make this more minimal.

Akuli commented 6 years ago

Hmm... here's your problem.

def processbutton():
  global bro
  bro=processbutton()

visualize() has the same problem.

I'm not sure why you are doing this, but this is very probably not what you want. My tutorial contains nothing like this.

niranjanreddy891 commented 6 years ago

Thanks for the reply @Akuli. My requirement is "User will select a file from browse button and when he clicks visualizebutton, visualization should start". Can you help me in this issue. I am a bit confused.

Akuli commented 6 years ago

Maybe it's best if you come to an actual chat where I can answer questions much faster than on github? I'm often on the ##learnpython IRC channel on freenode.

Anyway, the error has nothing to do with tkinter and it's saying that you should do pcl.load_XYZRGB(something) instead of just pcl.load_XYZRGB().

Akuli commented 6 years ago

I guess we're done here. If I'm on the chat I linked, just ask me there; if I'm not, you can also ask here on github.

niranjanreddy891 commented 6 years ago

Thanks for the help