python canvas tkinter and opensesame
Hello I would love for your help.
I'm new to opensesame but I know how to write code in Python.
I want to create an experiment that shows images and the same page present a mood Slider that you can click.
I've worked with tkinter before and I can't quite figure out how to work with the canvas() in open sesame..
I do not understand the difference between them in the software
can I create my own on-screen Slider widgets?
Comments
Hi,
If you use tkinter, you basically replace the default window that Opensesame creates when starting the experiment. While certainly possible to do so, it is not necessary. Instead you can just use Opensesame default functions, like a canvas, etc. which is effectively a display that you want to show.
As I mentioned in another discussion, browse the forum for slider implementations and use them as starting points to make your custom implementation.
I've worked with tkinter before and I can't quite figure out how to work with the canvas() in open sesame..Well, you basically create a window, draw on it and then show it. But of course you can make it more complicated, by accessing elements on it and changing its properties, for example based on the user response, etc..
cv = Canvas() cv.text('That is an example.',x=0,y=100,color='red') cv.show()Does that make sense?
Eduard
ps. let's try to keep the discussion central and not talk about the same issues in multiple threads.
Is there an option to combine them? I really struggling with creating gui widjet like an moving scale that you can drag the mouse only on the scale...
Is there another option?
Hi,
Not really I am afraid, but having a slider widget, whose value changes depending on the mouse position can be done with Opensesame directly without the need of invoking tkinter.
See for example here https://forum.cogsci.nl/discussion/4055/a-slider-widget-for-opensesame-3-2
Or am I misunderstanding your problem?
Eduard