[Q] Choosing the user level

Scott Wallace scott
Fri Apr 18 14:54:03 PDT 2003


At 2:21 PM +0100 3/14/02, Hannes Hirzel wrote:

>Is there already a global variable provided which chooses the user
>level; for example for the levels end-user, omni-user, expert?

No.  One lightweight way to add such a thing without needing a global 
is to make it a be a project parameter.  Apply "method names with it" 
(or cmd-shift-W) to the string 'projectparameter' and the resulting 
method-names-browser will show you what you need to call to set and 
get project parameters.


>How do I add a preference / switch so that I can
>choose that fewer and larger halos show up:
>
>I would just like to have
>
>- the duplication halo
>- the delete halo
>- the resize halo
>- the recolor halo

You've perhaps seen in the "halos" tab of Preferences a set of 
checkboxes inviting you to choose a "halo scheme".   If you click on 
"custom", a user-customizable halo scheme will be used, so that's one 
way for you easily to thread your new kinds of halos into the system.

Now to *define* what your custom halos are, just hit that "edit 
custom halos" button.  You'll need to grok the pattern by looking at 
the example code there.  I've pasted one possible modification to the 
custom-halos method below, one that shows your four chosen handles at 
the four corners of the halo, fwiw.  Just file it in, choose the 
"custom" halos scheme in Preferences, and see how you like it; then 
modify it until it does what you want.


>where the halos are just larger so that they can easier by activated with
>the mouse.

Navigate to HaloMorph in a browser, and from the class-list pane's 
menu choose "Class vars".  In the resulting 
class-variables-inspector, click on #HandleSize.  Note the current 
value (16) in the right-hand pane.  Type in the new value you want 
(e.g. 32) into the right hand pane and accept it (cmd-s or Enter). 
Voil?!  You can try it out right away by cmd-clicking on the 
class-variables-inspector itself.

  -- Scott

---------
!Preferences class methodsFor: 'halos' stamp: 'sw 3/14/2002 16:18'!
customHaloSpecs
	"Answer specifications for four handles, dismiss, duplicate, 
grow, recolor, to appear at the four corners of the halo."

	^ #(
(addDismissHandle: left	top (red muchLighter) 'Halo-Dismiss')
(addDupHandle: right top (green) 'Halo-Dup')
(addGrowHandle: right bottom (yellow) 'Halo-Scale')
(addScaleHandle: right bottom (lightOrange)'Halo-Scale')
(addRecolorHandle: left	bottom (magenta darker) 'Halo-Recolor'))! !
---------



More information about the Squeakland mailing list