Hey there, I have a previous post here, but didn’t know if I should put this there or not.
USING __import__() for variables - modules from subfolders
@tfox_TD absolutely nailed the answer for me on that previous post. Perhaps you could share how you would approach this, please?
I’ve updated said code but my layout of folders still stands, perhaps check the previous post for that.
Summary:
I am creating a FlowLayout with dynamically created buttons and passing them functions. When it comes to right clicking the button however, I am wondering where I would put that code if not the button’s .py file? I don’t understand how to pass those arguments from one class to the other.
I am creating my button in my ToolKit()
class,
I have my functional code for that button in another class in another file.
During creation of the button it is importing that button’s MainFunc()
class that has 3 functions: lmb()
, mmb()
, and rmb()
for different mouse clicks.
On Right Mouse Button click (rmb) I would like to have a menu pop up for that button’s code.
That menu would be different depending on the button. So anything from text inputs to radio buttons and check boxes.
How would I go about making that menu code?
Keep it in the button’s rmb()
? Or somehow create it dynamically from the UI code? I feel like my only option is from the button’s MainFunc(). But then how would I query that info if the UI exists now in another class? Rather confusing for me.
I’m unsure how to even write some example code for this as the overall concept eludes me.