class: MultiViewToolApplication
authorClaus Gittinger <cg@exept.de>
Sat, 25 Oct 2014 15:01:27 +0200
changeset 14805 3e0fc4db20cf
parent 14804 3cd896cf9959
child 14806 56a544a200ce
class: MultiViewToolApplication added: #addWindow:named:tabIcon: #addWindow:named:tabIcon:asFirst: changed: #addWindow:named:asFirst:
MultiViewToolApplication.st
--- a/MultiViewToolApplication.st	Sat Oct 25 15:01:11 2014 +0200
+++ b/MultiViewToolApplication.st	Sat Oct 25 15:01:27 2014 +0200
@@ -918,7 +918,15 @@
 !
 
 addWindow:aWindow named:name asFirst:asFirst
-    |tabList wsIndex newSelectedIndex w|
+    ^ self addWindow:aWindow named:name tabIcon:nil asFirst:asFirst
+!
+
+addWindow:aWindow named:name tabIcon:iconOrNil
+    ^ self addWindow:aWindow named:name tabIcon:iconOrNil asFirst:false
+!
+
+addWindow:aWindow named:name tabIcon:iconOrNil asFirst:asFirst
+    |tabList tabItem wsIndex newSelectedIndex w|
 
     tabList := self tabList.
     wsIndex := tabList size + 1.
@@ -928,13 +936,18 @@
         wsIndex := wsIndex + 1.
     ].
 
+    tabItem := name bindWith:wsIndex.
+    iconOrNil notNil ifTrue:[
+        tabItem := LabelAndIcon icon:iconOrNil string:tabItem.
+    ].
+
     workspaces grow:wsIndex.
     asFirst ifTrue:[
-        tabList addFirst:(name bindWith:wsIndex).
+        tabList addFirst:tabItem.
         workspaces replaceFrom:2 to:wsIndex with:workspaces startingAt:1.
         newSelectedIndex := 1.
     ] ifFalse:[
-        tabList addLast:(name bindWith:wsIndex).
+        tabList addLast:tabItem.
         newSelectedIndex := wsIndex.
     ].
 
@@ -1389,6 +1402,6 @@
 !MultiViewToolApplication class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/MultiViewToolApplication.st,v 1.50 2014-07-01 20:00:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/MultiViewToolApplication.st,v 1.51 2014-10-25 13:01:27 cg Exp $'
 ! !