Comments (4)
You need the right indentation in the class! if the method indicator_settings
should be a function of the CTk class, the it should definitely look like def indicator_settings(self, slider_value):
. If its just a temporary function inside of the init method it should look like def indicator_settings(slider_value):
! But this is not a customtkinter related problem, so please refer to other websites like StackOverflow or python tutorials on classes and functions.
from customtkinter.
Hi, is it correct that your indicator_settings
method is indented? If yes this is wrong, it should at the same indentation level as the other class functions. The second problem is that you assigned the indicator_settings
function as command for the sliders, but a slider command callback function gets passed the value of the specific slider it gets called from, so your'e slider callback function should look like this: def indicator_settings(self, slider_value)
. And if you then get the value from the lsiders directkly with .get()
inside the callback you don't need to use the value, but it needs to be in the function header as an argument.
But what I would do is to create a different callback function for every slider, or use tkinter variables.
from customtkinter.
Hi, is it correct that your
indicator_settings
method is indented? If yes this is wrong, it should at the same indentation level as the other class functions. The second problem is that you assigned theindicator_settings
function as command for the sliders, but a slider command callback function gets passed the value of the specific slider it gets called from, so your'e slider callback function should look like this:def indicator_settings(self, slider_value)
. And if you then get the value from the lsiders directkly with.get()
inside the callback you don't need to use the value, but it needs to be in the function header as an argument.But what I would do is to create a different callback function for every slider, or use tkinter variables.
Hi, thanks for your reply
Im now only using 1 function per slider
def indicator_settings_1(self, slider_value): val_supertrend_atr = self.slider_atr.get()
self.slider_atr = customtkinter.CTkSlider(master=self.frame_right, from_=1, to=32, number_of_steps=31, command=indicator_settings, )
however this returns the error TypeError: App.__init__.<locals>.indicator_settings() missing 1 required positional argument: 'slider_value' PS C:\Users\user\pyto\projects\website_bots\front>
When trying to make the same function without the argument ( def indicator_settings_1(self,): val_supertrend_atr = self.slider_atr.get()
)
it returns the same error as before ( val_supertrend_atr = self.slider_atr.get() AttributeError: 'float' object has no attribute 'slider_atr'
)
from customtkinter.
def indicator_settings(self):
print(self)
This worked!
from customtkinter.
Related Issues (20)
- pady button make bug HOT 1
- Problem file: simple_example.py
- how to use webkit in customtkinter? HOT 1
- How can I use Label Frame in CTK HOT 1
- Error when using Auto Py to Exe HOT 1
- _tkinter.TclError: can't invoke "winfo" command: application has been destroyed
- canvas.coords is not returning any values HOT 1
- how to use font from `.ttf` file HOT 3
- How to change the icon in CTkInputDialog HOT 4
- TypeError: CTkEntry.xview() takes 2 positional arguments but 3 were given HOT 3
- No CTkTreeView? HOT 10
- Can you change the font in a CTkTextBox with tags?
- 2656125603072update whats problem when i click on button HOT 2
- I can't add widgets to CTkTabview's Tab buttons
- Button Not Appearing HOT 1
- Unable to run examples: segmentation fault
- Bind "Enter Key" to button does not work HOT 4
- Switch does not go to the required position HOT 1
- ctk.CTk().state("zoomed") doesn't work HOT 1
- Invoking .geometry(), .winfo_height() or .winfo_width() on a window always returns 200 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from customtkinter.