GT Presentation: Show Conditionally?

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

GT Presentation: Show Conditionally?

Sean P. DeNigris
Administrator
Is there a way to specify that a presentation should only be used if a certain condition is met? The use case I have in mind is adding the Magritte presentation to object, but only showing if the object has a Magritte description. It is a PITA to have to copy/paste the presentation method into every Magritte-described object...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: GT Presentation: Show Conditionally?

Tudor Girba-2
use a when: clause.

For example, look at:

FileReference>> gtInspectorPngIn: composite
<gtInspectorPresentationOrder: 0>
composite morph
title: 'Picture';
display: [ self binaryReadStreamDo: [ :stream | PNGReadWriter formFromStream: stream ] ];
when: [ self mimeTypes notNil and: [ self mimeTypes first matches: ZnMimeType imagePng ] ]

Cheers,
Doru



On Sun, May 31, 2015 at 7:50 PM, Sean P. DeNigris <[hidden email]> wrote:
Is there a way to specify that a presentation should only be used if a
certain condition is met? The use case I have in mind is adding the Magritte
presentation to object, but only showing if the object has a Magritte
description. It is a PITA to have to copy/paste the presentation method into
every Magritte-described object...



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/GT-Presentation-Show-Conditionally-tp4829638.html
Sent from the Moose mailing list archive at Nabble.com.
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: GT Presentation: Show Conditionally?

Sean P. DeNigris
Administrator
Tudor Girba-2 wrote
use a when: clause.
Perfect :)
Cheers,
Sean