Forum OpenACS Q&A: XOTcl Question

Collapse
Posted by Richard Hamilton on
I am trying to work through some XOTcl code to understand it and I want to be able to refer to the code for the various methods so that I can see how things go together.

In the following code:

TableWidget t1 -volatile -columns ....etc.....

I can see that TableWidget inherits the volatile method from ::xotcl::Object, and I note that all methods with a 'c' superscript seem to be NOT displayed in the api browser. Does the 'c' mean that the method is inherited from a superclass? If so where are the method declarations kept (since ::xotcl::Object seems to be the top of the hierarchy in the API browser)?

https://openacs.org/xotcl/show-object?show%5fmethods=1&show%5fsource=0&object=%3a%3aTableWidget

So I cannot find the code for methods such as 'volatile'.

Also, why is there a hyphen when '-volatile' and 'column' are used? They look like parameters but are listed as methods.

I will continue to work through the tutorial and I apologise if the answers to these questions are in front of me.

Regards
Richard

Collapse
2: Re: XOTcl Question (response to 1)
Posted by Gustaf Neumann on
The "C" stands for "implemented in C". The C implemented methods (and other predefined methods of XOTcl) are documented in the language reference (http://media.wu.ac.at/doc/langRef-xotcl.html). To see the source-code, you would have to study the implementation of XOTcl.

Concerning the dashes ('-'): One can invoke every defined method during object creation by prefixing the method name with the dash...

Collapse
3: Re: XOTcl Question (response to 2)
Posted by Richard Hamilton on
Thank you Gustaf, that was a great help. I had decided to go through the tutorial before reading the language reference. Perhaps I should do it the other way around! 😊

R.

Collapse
4: Re: XOTcl Question (response to 3)
Posted by Gustaf Neumann on
The reference manual is for the documentation of the predefined methods. Note that there is as well the XOTcl Tutorial http://media.wu.ac.at/doc/tutorial.html that might serve better for starters...