Python Forum
How to pass variables from one class to another
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pass variables from one class to another
#13
(Sep-23-2021, 12:15 PM)deanhystad Wrote: We are getting close now. How about you add the code to set the value in OrthoView and add the code to use the value in MyToolBar.set_message. I know it won't run anymore, but I am still unclear about what the dependency is.

I don't think there is any class dependency here since you are talking about things that happen in __init__. MyToolBar should be able to get whatever INSTANCE VARIABLE values it needs from the OrthoView OBJECT using the instance passed when you create the toolbar.

Can you please provide me example code in order to understand? Thanks...
Reply


Messages In This Thread
RE: How to pass variables from one class to another - by hobbyist - Sep-23-2021, 12:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unchangeable variables in a class? Calab 12 1,579 Sep-15-2023, 07:15 PM
Last Post: deanhystad
  How to pass encrypted pass to pyodbc script tester_V 0 881 Jul-27-2023, 12:40 AM
Last Post: tester_V
  Class variables and Multiprocessing(or concurrent.futures.ProcessPoolExecutor) Tomli 5 3,917 Nov-12-2021, 09:55 PM
Last Post: snippsat
  Acess variables from class samuelbachorik 3 1,915 Aug-20-2021, 02:55 PM
Last Post: deanhystad
Exclamation win32com: How to pass a reference object into a COM server class Alfalfa 3 4,923 Jul-26-2021, 06:25 PM
Last Post: Alfalfa
  Do I have to pass 85 variables to function? Milfredo 10 4,345 Sep-26-2020, 10:13 PM
Last Post: Milfredo
  Pass by object reference when does it behave like pass by value or reference? mczarnek 2 2,573 Sep-07-2020, 08:02 AM
Last Post: perfringo
  Class variables menator01 2 2,024 Jun-04-2020, 04:23 PM
Last Post: Yoriz
  Question about naming variables in class methods sShadowSerpent 1 2,025 Mar-25-2020, 04:51 PM
Last Post: ndc85430
  Pass by reference vs Pass by value leodavinci1990 1 2,225 Nov-20-2019, 02:05 AM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020