Si podes traduci estas paginas y agregalas al Swiki
Lic. Edgar J. De Cleene
edgardec2001 at yahoo.com.ar
Sun Sep 11 09:04:34 UTC 2005
http://minnow.cc.gatech.edu/squeak/2176
http://minnow.cc.gatech.edu/squeak/3644
http://minnow.cc.gatech.edu/squeak/666
A esto agregale mis recetas, siempre que sean distintas
Si falta una clase/metodo en imagen (y no puede importarse)
FileStream fileIn: 'Socket.st'.
Como copiar lo que se haya dibujado en la pantalla y convertirlo en un Morph
(para no perderlo)
m _ (Form fromDisplay: Display boundingBox ) asMorph.
m openInWorld.
Como generar numeros aleatorios sin repeticiÛn
"Algoritmo mejorado del G3 "
| ordendePiezas cantPiezas randomNumber |
cantPiezas _ 124.
Transcript open.
ordendePiezas _ OrderedCollection new.
[ordendePiezas size < cantPiezas]
whileTrue: [(ordendePiezas includes: (randomNumber _ cantPiezas
atRandom))
ifFalse: [ordendePiezas add: randomNumber]].
ordendePiezas do: [ :i| Transcript show: (ordendePiezas at: i); cr.].
ActiveWorld removeAllMorphs. para limpiar el escritorio
Crear botones a partir de archivos de imagen
f _ Form fromFileNamed: 'Macintosh
HD:Users:edgar:Public:SqueakDevelop:SqueakChemM.jpg'. "Elejir el path del
boton deseado con el FileList"
esteBoton _ IconicButton new. "Creamos una instancia de IconicButton "
esteBoton initialize. "La inicializamos "
esteBoton labelGraphic: f. "Hacemos que utilice nuestro grafico "
esteBoton openInWorld.
Morphs que esten sobre morphs de una clase especial
intersectWhatMorph
| l |
l _ ActiveWorld submorphs
select: [:each | each class == TrackMorph]
thenCollect: [:m | (self bounds intersects: m bounds)
ifTrue: [m]].
l _ l
reject: [:any | any
== nil ].
^l
Como cargar un morph de un archivo y abrirlo en el mundo
archivo _ FileStream readOnlyFileNamed: 'PruebaArbol.morph'.
miMorph _ archivo fileInObjectAndCode.
miMorph openInWorld.
Si es un objeto exteno
| inputStream anObject |
inputStream _ FileStream oldFileNamed: 'ListaClases.obj'.
anObject _ inputStream fileInObjectAndCode.
inputStream close.
(Inspector openAsMorphOn: anObject) openInHand
saveOnFile graba el objeto
Atajo para que nos quede el directorio Squeaklets , si existe, como opcion
al botÛn FIND del navegador de proyectos
| repository |
repository _ FileDirectory default pathName ,FileDirectory
slash,'Squeaklets' .
(FileDirectory default directoryExists: repository) ifTrue:
[ServerDirectory addLocalProjectDirectory: (FileDirectory on: repository) ]
ifFalse:[PopUpMenu inform: 'No hay directorio Squaklets ']
Mapeo botones
For most 3-button mice, the mapping is:
left-mouse -> "red" (a.k.a. primary)
middle-mouse -> "yellow" (a.k.a. secondary)
right-mouse -> "blue" (a.k.a. meta or tertiary)
Most Win32 machines have only 2-button mice. On them, the mapping is:
left-mouse -> "red" (primary)
right-mouse -> "yellow" (secondary)
alt-left-mouse -> "blue" (meta)
However, if you do have a 3-button mouse on Win32, you might want to set the
"use 3 button mapping" to get the default reading from above. To do this,
right-click on the Windows titlebar of the Squeak application (or press F2),
and select the "VM Preferences->Use 3 button mouse mapping" menu item.
Finally, Macs only have one mouse button. The mapping on Macs is:
mouse -> "red" (primary)
option-mouse -> "yellow" (secondary)
cmd-mouse -> "blue" (meta)
Ejemplo de case
escribircaso: linea
| letra |
1 to: linea size do:
[:i|
letra _ (linea at: i) asLowercase.
letra caseOf: {
[$a ] -> [self A].[$b ] -> [self B].
[$c ] -> [self C].
[$1] -> [self uno].
[$2] -> [self dos].
[$3] -> [self tres].
}otherwise: [Transcript open.
Transcript show: 'Ese simbolo no lo se dibujar'].
]
FlapsRegistry
a tool can be registered to appear in a flap
for an example:
-select the next two lines and do it
Flaps registerQuad: #(FileList2 openMorphicViewInWorld 'Enhanced File
List'
'A nicer File List.')
forFlapNamed: 'Tools'.
Flaps replaceToolsFlap
-if you don''t like the FileList in the tools flap, remove it with the next
two lines:
Flaps unregisterQuadsWithReceiver: FileList fromFlapNamed:'Tools'.
Flaps replaceToolsFlap
Note: after registering or unregistering, the flap need to be
manually recreated see Flaps class>>replace*Flap methods
ActiveWorld restoreMorphicDisplay
Flaps unregisterQuadsWithReceiver: SelectorBrowser fromFlapNamed:'Tools'.
Flaps replaceToolsFlap.
Flaps unregisterQuadsWithReceiver: ChangeSorter fromFlapNamed:'Tools'.
Flaps replaceToolsFlap.
Flaps unregisterQuadsWithReceiver: FileList fromFlapNamed:'Tools'.
Flaps replaceToolsFlap.
Flaps registerQuad: #(FileList2 openMorphicViewInWorld 'Enhanced File
List'
'A nicer File List.')
forFlapNamed: 'Tools'.
Flaps replaceToolsFlap.
Using the ProportionalLayout is probably the easiest way.
For instance, try this in a Workspace:
field _ RectangleMorph new extent: 300 at 300; openInWorld.
field layoutPolicy: ProportionalLayout new.
1 to: 3 do: [ :row |
1 to: 3 do: [ :col |
field addMorph: (RectangleMorph new color: Color red)
fullFrame: (LayoutFrame fractions: (((row - 1)/3.0 @ ((col -
1)/3.0)) extent: 0.333 at 0.333))
]
]
Comandos del menu
TheWorldMenu registeredOpenCommands. #(#('Balloon3D Tutorial'
#(B3DTutorialPresenter #openTutorial)) #('DVS Package Panel' #(PackagePanel
#open)) #('email reader' #(Celeste #open) '"Celeste", an e-mail client')
#('IRC chat' #(IRCConnection #openConnectionView) 'Internet Relay Chat')
#('Kom Package Panel' #(KomPackagePanel #open)) #('Monticello Browser'
#(MCWorkingCopyBrowser #open)) #('Package Loader' #(SMLoader #open))
#('StarBrowser' #(StarBrowser #open)) #('Test Runner' #(TestRunner #open))
#('VMMaker' #(VMMakerTool #openInWorld) 'The VM making tool') #('web
browser' #(Scamper #openAsMorph) '"Scamper", a web browser') #('Wonderland
3D' #(Wonderland #new)))
Seleccion de valores en diccionario
associations _ ((Smalltalk keys select: [:aKey | ((Smalltalk at: aKey)
isKindOf: Class) not]) asSortedArray collect:
Si esta colgado:
1) Abrir un Process Browser.
2) Matar todo lo que se pueda.
Actualizar imagenes distintas sin conectar
En la mas nueva
FileDirectory default directoryNamed: 'updates'.
ChangeSet allInstances select: [:c| (c name startsWithDigit) & (c name >
'5956') ] thenCollect:[ :any| any fileOut ]
En la otra
Utilities applyUpdatesFromDiskToUpdateNumber: 5700 stopIfGap: false
Ver en SqueakLight:
self setToAdhereToEdge: #bottom Para los botones
self setToAdhereToEdge: #bottomRight : Para seleccionar los BookMorphs
___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar
More information about the Squeak-dev
mailing list
|