Skip to content

Next/Previous button, and checkbox / bool like button? #942

Answered by marcomusy
NikDrummond asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, I made some modifications to Button class, try

pip install -U git+https://github.com/marcomusy/vedo.git

then

from vedo import *


def scroll_left(obj, ename):
    global index
    i = (index - 1) % len(meshes)
    txt.text(meshes[i].name).c("k")
    plt.remove(meshes[index]).add(meshes[i])
    plt.reset_camera()
    index = i

def scroll_right(obj, ename):
    global index
    i = (index + 1) % len(meshes)
    txt.text(meshes[i].name).c("k")
    plt.remove(meshes[index]).add(meshes[i])
    plt.reset_camera()
    index = i

def flag(obj, ename):
    global index
    txt.text("Flag Button Pressed!").c("r")
    plt.reset_camera()


# load some meshes
m1 = Mesh(dataurl + "bunny.obj").c("…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@NikDrummond
Comment options

@marcomusy
Comment options

@NikDrummond
Comment options

@NikDrummond
Comment options

@NikDrummond
Comment options

Comment options

You must be logged in to vote
1 reply
@NikDrummond
Comment options

Answer selected by marcomusy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants