Hello,
I am trying to achieve a kind of ‘dinamic objects creation’ in the following sense.
I am working on a project in mathematics, but I am not an experienced developer. Let’s say that I have various tables in my DB which store data of the same kind.
For instance, I can have various sets, and on each set I have defined a few operations which belong to the particular set:
- set A, operations +, -
- Set B, opeartions * , ! , #
- Set C + , * , !!
(notice that a set may have tens of operation defined upon itself, and that the fact that two operation have the same name on two different set does not mean they are the same thing: thus, I have all of my sets defined in a table SETS, and every row of SETS is linked to a table OPERATIONS).
Now, I would need to create an interface that, when working on a set, automatically fills a grid of buttons which have the name of the operation as text property (and this I was able to do, with a for loop on the iterable returned by app_tables.table_name,search() ), and such that all buttons automatically trigger the same function carry_out_operation(‘operation_name’) in the form, which then handles the operation properly.
If I had access to the Button Class, then I could create a derived instance of it where the click method is a priori bounded to carry_out_operation, but it that class cannot be accessed. Help please?