On 05 Oct 2014, at 10:08, Yuriy Tymchuk <yuriy.tymchuk@me.com> wrote:Yes, but as I���ve mentioned earlier, I���m interested in drag-n-drop recategorization. I don���t know if it���s doable with glamour.UkoOn 04 Oct 2014, at 15:58, Esteban Lorenzano <estebanlm@gmail.com> wrote:and this is same with glamour:browser := GLMTabulator newrow: [ :row |rowcolumn: #protocols;column: #methods ];row: #code;yourself.browser transmitto: #protocols;andShow: [ :a| a list display: [ :class | class organization protocols ]; format: #name ].browser transmitfrom: #protocols;to: #methods;andShow: [ :a| a list display: [ :protocol | protocol methods ] ].browser transmitfrom: #methods;to: #code;andShow: [ :a |a smalltalkCodesmalltalkClass: [ browser entity ];display: [ :method | (browser entity>>method) sourceCode ] ].browser openOn: Morph.Of course spec is capable of doing that.But glamour is designed with transitions and scripting in mind (thinking specially on browsers), while spec is designed for components and composition.EstebanOn 04 Oct 2014, at 15:35, Nicolai Hess <nicolaihess@web.de> wrote:
2014-10-03 13:26 GMT+02:00 Esteban Lorenzano <estebanlm@gmail.com>:yes, but a few models means a few classes :)On 03 Oct 2014, at 13:14, Nicolai Hess <nicolaihess@web.de> wrote:
Am 03.10.2014 12:34 schrieb "Yuriy Tymchuk" <yuriy.tymchuk@me.com>:
>
> Hi.
>
> I want to make something like a browser on a single class. I.e. just use 2 last lists out if 4 in standard browser.
>
> Is there already something like that? If not, should I use existing widgets, or implement my own using spec?
>
> Cheers!
> Uko
>
> Sent from my iPhoneI think that is pretty easy with some spec models.
Maybe there is already an examplein a single class, it will e a lot easier glamour (which btw, is specially designed for that: to make browsers).You can work with ready made models like ListModel/TextModel and just need one class for sticking them
together. Here some code, evaluateable from workspace, that shows how we
can build a "simple browser" with spec models:This is just the simple skeleton, for more details it would be a bit confusing doing all this
in one workspace "script" :)
class:=Morph.
method:=class>>#openInWorld.
composed:= DynamicComposableModel new.
composed instantiateModels: #(code TextModel protocols ListModel methods ListModel).
composed code text:method sourceCode.
composed protocols items: class protocols.
composed methods items: class selectors.
composed code aboutToStyle:true.
composed code behavior:class.
composed title: class asString.
composed code acceptBlock:[:text |
class compile:text notifying:nil.
].
composed protocols whenSelectedItemChanged:[:item |
composed methods items:( class selectorsInProtocol: item)
].
composed methods whenSelectedItemChanged:[:item |
item ifNotNil:[
method:=class methodDict at:item.
composed code text:method sourceCode]
].
composed openWithSpecLayout:(
SpecLayout composed
newColumn:[:c | c
newRow:[:r | r
add: #protocols;
add: #methods
];
add: #code];
yourself).EstebanHilaire asked for a simple Method editor and
i wrote a simple example build with DynamicComposableModel, search the Mailingliste.