Skip to content

Commit 06c9fbb

Browse files
committed
Fix issue 105
1 parent 3d5c625 commit 06c9fbb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/src/main/scala/scala/swing/examples/UIDemo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ object UIDemo extends SimpleSwingApplication {
114114
}
115115
}
116116

117-
pages += new Page("Password", password)
117+
pages += new Page("Password", password, "Password tooltip")
118118
pages += new Page("Painting", LinePainting.ui)
119119
//pages += new Page("Text Editor", TextEditor.ui)
120120
}

src/main/scala/scala/swing/TabbedPane.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ object TabbedPane {
4646
def content_=(c: Component): Unit = { _content = c; if (parent != null) parent.peer.setComponentAt(index, c.peer) }
4747
protected var _tip: String = tip0
4848
def tip: String = _tip//peer.getToolTipTextAt(index)
49-
def tip_=(t: String): Unit = { _tip = t; if (parent != null) parent.peer.setToolTipTextAt(index, t) }
49+
def tip_=(t: String): Unit = { _tip = t; if (parent != null) parent.peer.setToolTipTextAt(index, if(t == "") null else t) }
5050
protected var _enabled = true
5151
def enabled: Boolean = _enabled//peer.isEnabledAt(index)
5252
def enabled_=(b: Boolean): Unit = { _enabled = b; if (parent != null) parent.peer.setEnabledAt(index, b) }
@@ -93,12 +93,12 @@ class TabbedPane extends Component with Publisher {
9393
override def insert(n: Int, t: Page): Unit = {
9494
//for(i <- n to length) apply(i)._index += 1
9595
t.parent = TabbedPane.this
96-
peer.insertTab(t.title, null, t.content.peer, t.tip, n)
96+
peer.insertTab(t.title, null, t.content.peer, if(t.tip == "") null else t.tip, n)
9797
}
9898

9999
override def addOne(t: Page): this.type = {
100100
t.parent = TabbedPane.this
101-
peer.addTab(t.title, null, t.content.peer, t.tip)
101+
peer.addTab(t.title, null, t.content.peer, if(t.tip == "") null else t.tip)
102102
this
103103
}
104104

0 commit comments

Comments
 (0)