如何在 Pharo 9 中制作带有子组的包
在 Pharo 9 中,如何创建一个具有子包层次结构的包,就像“Announcements-Core”中那样,其中有一个展开和折叠箭头?
我认为它可能基于包的名称,但是当我尝试使用以下消息创建两个类时,它们只是显示为单独的包。我想要的是有一个包“T-base”,它有子包“type1”和“type2”?
Object subclass: #T1 instanceVariableNames: '' classVariableNames: '' package: 'T-base-type1'
Object subclass: #T2 instanceVariableNames: '' classVariableNames: '' package: 'T-base-type2'
In Pharo 9, how do I create a package that has a hierarchy of sub-packages like in "Announcements-Core" where there is an expanding and collapsing arrow?
I thought that it might be based on the names of the packages but when I tried with the following messages to create two classes they just show up as separate packages. What I want is for there to be a package "T-base" that has sub packages "type1" and "type2"?
Object subclass: #T1 instanceVariableNames: '' classVariableNames: '' package: 'T-base-type1'
Object subclass: #T2 instanceVariableNames: '' classVariableNames: '' package: 'T-base-type2'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要创建新包和其中的(所谓的)标签,请使用右键单击菜单项
New package
和New tag
。包是RPackage
的实例和ClyTaggedClassGroup
的标签。To create a new package and a (so called) tag inside it use the right-click menu items
New package
andNew tag
. Packages are instances ofRPackage
and tags ofClyTaggedClassGroup
.要添加到 Leandro 的答案,要在 Smalltalk 代码中执行此操作,您可以执行以下操作:
t1 class package
为您提供RPackage
实例,然后您可以将该类添加到标记中。我还发现你需要让包名称的最后部分(例如type1)与标签名称相同,否则会出现该类“未分类”的错误。还有另一种方法:您可以创建没有包名称最后部分的类,然后将
category:
消息发送到该类以将其添加到To add to Leandro's answer, to do this in smalltalk code you can do this:
t1 class package
gives you theRPackage
instance and you can then add the class to a tag. I also found that you need to have the final part of the package name (eg. type1) be the same as the tag name, otherwise there is an error that the class is "uncategorized".There is another way as well: You can create the class without the final part of the package name and then send the
category:
message to the class to add it on