On 05/06/2018 13:41, Pavel Krivanek wrote:
> In the current menu bar in Pharo 7 I miss launcher icons. This is a
> quick ad-hoc tweak how to add them:
> 
> 
> 
> MenubarMorph reset.
> 
> World menubar submorphs second delete.
> 
> World menubar addMorph: (SimpleButtonMorph new 
> label: '|';
> actionSelector: #value; color: Color transparent; borderWidth: 0;
> yourself) after: World menubar submorphs first.
> 
> World menubar addMorph: (IconicButton new 
> target: [ Smalltalk saveSession ]; 
> helpText: 'Save image';
> labelGraphic: (self iconNamed: #smallSave); 
> actionSelector: #value; color: Color transparent; borderWidth: 0;
> yourself) after: World menubar submorphs first.
> 
> World menubar addMorph: (SimpleButtonMorph new 
> label: '|';
> actionSelector: #value; color: Color transparent; borderWidth: 0;
> yourself) after: World menubar submorphs first.
> 
> World menubar addMorph: (IconicButton new 
> target: [ IceTipRepositoriesBrowser  new openWithSpec ]; 
> helpText: 'Iceberg';
> labelGraphic: (IceTipRepositoriesBrowser icon); 
> actionSelector: #value; color: Color transparent; borderWidth: 0;
> yourself) after: World menubar submorphs first.
> World menubar addMorph: (IconicButton new 
> target: [ Smalltalk tools openTestRunner ]; 
> helpText: 'Test runner';
> labelGraphic: ( self iconNamed: #testRunnerIcon); 
> actionSelector: #value; color: Color transparent; borderWidth: 0;
> yourself) after: World menubar submorphs first.
> 
> World menubar addMorph: (IconicButton new 
> target: [ Smalltalk tools openWorkspace  ]; 
> helpText: 'Playground';
> labelGraphic: ( Smalltalk tools workspace taskbarIcon); 
> actionSelector: #value; color: Color transparent; borderWidth: 0;
> yourself) after: World menubar submorphs first.
> World menubar addMorph: (IconicButton new 
> target: [ Smalltalk tools browser open ]; 
> helpText: 'System browser';
> labelGraphic: (self iconNamed: #nautilus); 
> actionSelector: #value; color: Color transparent; borderWidth: 0;
> yourself) after: World menubar submorphs first.
> 
> World menubar addMorph: (SimpleButtonMorph new 
> label: '|';
> actionSelector: #value; color: Color transparent; borderWidth: 0;
> yourself) after: World menubar submorphs first.
> 
> World menubar addMorphBack: (SimpleButtonMorph new 
> label: '|';
> actionSelector: #value; color: Color transparent; borderWidth: 0; yourself).
> 
> World menubar addMorphBack: (IconicButton new 
> target: [ self inform: 'hello world' ]; 
> helpText: 'custom action';
> labelGraphic: (self iconNamed: #glamorousGo); 
> actionSelector: #value; color: Color transparent; borderWidth: 0; yourself).
> 

Hi,

I just created a PR to ease the creation of separators:

https://github.com/pharo-project/pharo/pull/1486

GIF displaying the result is visible on this issue.

-- 
Cyril Ferlicot
https://ferlicot.fr

Reply via email to