Trouble while defining a customized tab in GT inspector

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble while defining a customized tab in GT inspector

Luc Fabresse
Hi all,

I try to play with the GT inspector (thx Andrei and Doru for the great hands on session @ ESUG'14!).

In short, I try to add a customized tab for Persons objects using a PersonUI facade and a subclass of GTObjectVariablesBrowser (ok I can explain why if needed ;-)). Like that:

Person>>gtInspectorCustomUIIn: composite
<gtInspectorPresentationOrder: 5>
^ (composite custom: (MyGTCustomObjectVariablesBrowser new startOn: (PersonUI on: self) )) " <----- HERE"
title: 'Customized view';
yourself

But, the #variableValuePairsFor: message is not sent to the PersonUI object but to the Person object even if I passed a PersonUI one to the #startOn: method (cf. HERE).
startOn: seems to not store properly the object to use afterwards or I missed a something. Did I?

please find a code sample attached if needed.
Try: 
Person new inspect 

Thx for any hint,
Cheers,

#Luc

LucGT-Experiements.st (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trouble while defining a customized tab in GT inspector

Tudor Girba-2
Hi,

Sorry for the late reply.

Indeed the ObjectVariablesBrowser does not work with another object then the one of the tab. If you want to define a custom tab, you should simply create a table with the desired variables. For example, take a look at Morph>>gtInspectorMorphExtensionIn:. This one exposes the extensions dictionary as a separate tab. It probably matches what you want.

Let me know if you still have troubles.

Cheers,
Doru



On Wed, Oct 29, 2014 at 10:29 PM, Luc Fabresse <[hidden email]> wrote:
Hi all,

I try to play with the GT inspector (thx Andrei and Doru for the great hands on session @ ESUG'14!).

In short, I try to add a customized tab for Persons objects using a PersonUI facade and a subclass of GTObjectVariablesBrowser (ok I can explain why if needed ;-)). Like that:

Person>>gtInspectorCustomUIIn: composite
<gtInspectorPresentationOrder: 5>
^ (composite custom: (MyGTCustomObjectVariablesBrowser new startOn: (PersonUI on: self) )) " <----- HERE"
title: 'Customized view';
yourself

But, the #variableValuePairsFor: message is not sent to the PersonUI object but to the Person object even if I passed a PersonUI one to the #startOn: method (cf. HERE).
startOn: seems to not store properly the object to use afterwards or I missed a something. Did I?

please find a code sample attached if needed.
Try: 
Person new inspect 

Thx for any hint,
Cheers,

#Luc



--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: Trouble while defining a customized tab in GT inspector

Luc Fabresse
Hi Doru, 

Thanks for your answer.
It worked as you suggested, but I had to copy three methods of ObjectVariablesBrowser (evaluatorIn:, printStringOf: and stringWithoutInitialCommentFrom:) to reproduce the evaluator part of the tab. 
I am not really happy with that but perhaps there is no other way.  

I still think that the startOn: method of ObjectVariablesBrowser should not loose the object passed in. Any explanation why  an ObjectVariablesBrowser cannot be "pluggable"?

Cheers,

Luc

2014-11-01 21:15 GMT+01:00 Tudor Girba <[hidden email]>:
Hi,

Sorry for the late reply.

Indeed the ObjectVariablesBrowser does not work with another object then the one of the tab. If you want to define a custom tab, you should simply create a table with the desired variables. For example, take a look at Morph>>gtInspectorMorphExtensionIn:. This one exposes the extensions dictionary as a separate tab. It probably matches what you want.

Let me know if you still have troubles.

Cheers,
Doru



On Wed, Oct 29, 2014 at 10:29 PM, Luc Fabresse <[hidden email]> wrote:
Hi all,

I try to play with the GT inspector (thx Andrei and Doru for the great hands on session @ ESUG'14!).

In short, I try to add a customized tab for Persons objects using a PersonUI facade and a subclass of GTObjectVariablesBrowser (ok I can explain why if needed ;-)). Like that:

Person>>gtInspectorCustomUIIn: composite
<gtInspectorPresentationOrder: 5>
^ (composite custom: (MyGTCustomObjectVariablesBrowser new startOn: (PersonUI on: self) )) " <----- HERE"
title: 'Customized view';
yourself

But, the #variableValuePairsFor: message is not sent to the PersonUI object but to the Person object even if I passed a PersonUI one to the #startOn: method (cf. HERE).
startOn: seems to not store properly the object to use afterwards or I missed a something. Did I?

please find a code sample attached if needed.
Try: 
Person new inspect 

Thx for any hint,
Cheers,

#Luc



--

"Every thing has its own flow"