[Newbies] How do I lock a Morphic GUI?

Hannes Hirzel hannes.hirzel at gmail.com
Thu Nov 4 18:28:30 UTC 2010


Fine, this is the right place to look for

Preferences
disableProgrammerFacilities
	"Warning: do not call this lightly!  ...."

	Beeper beep.
	(self
		confirm: 'CAUTION!!
This is a drastic step!
Do you really want to do this?')
			ifFalse:
				[Beeper beep.
				^self inform: 'whew!'].
	self disable: #cmdDotEnabled.	"No user-interrupt-into-debugger"
	self compileHardCodedPref: #cmdGesturesEnabled enable: false.	"No halos, etc."
	self compileHardCodedPref: #cmdKeysInText enable: false.	"No user
commands invokable via cmd-key combos in text editor"
	self enable: #noviceMode.	"No control-menu"
	self disable: #warnIfNoSourcesFile.
	self disable: #warnIfNoChangesFile.
	SmalltalkImage current saveAs



So I think

self compileHardCodedPref: #cmdGesturesEnabled enable: false.	"No halos, etc."

does the job.

I went to

#cmdGesturesEnabled

which is true and set it to false.

The halos are still there if I right-click (Windows, two-button mouse,
mouse buttons swapped in preferences)

What am I missing?


--Hannes

On 11/4/10, Herbert König <herbertkoenig at gmx.net> wrote:
> Hi Hannes,
>
> HH> Is there a preference for this? Searching for 'lock' and searching for
> HH> 'halo' did not bring up anything useful.
> HH> How is it done programmatically?
> from:
>
> Preferences>>disableProgrammerFacilities
>         "Warning: do not call this lightly!  It disables all access to
> menus, debuggers, halos.  There is no guaranteed return from this, which is
> to say, you cannot necessarily reenable these things once they are disabled
> -- you can only use whatever the UI of the current project affords, and you
> cannot even snapshot -- you can only quit.
>
>      You can completely reverse the work of this method by calling the dual
> Preferences method enableProgrammerFacilities, provided you have left
> yourself leeway to bring about a call to that method.
>
>         To set up a system that will come up in such a state, you have to
> request the snapshot in the same breath as you disable the programmer
> facilities.  To do this, put the following line into the 'do' menu and then
> evaluate it from that 'do' menu:
>
>          Preferences disableProgrammerFacilities.
>
> You will be prompted for a new image name under which to save the resulting
> image."
>
> --
> Cheers,
>
> Herbert
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>


More information about the Beginners mailing list