Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

85 lines (59 sloc) 1.839 kb
GtkConcreteWidget subclass: GtkSidebarWidget [
GtkSidebarWidget class >> addAll: anArray [
<category: 'instance creation'>
^ self new
addAll: anArray;
yourself
]
GtkSidebarWidget class >> new [
<category: 'instance creation'>
^ super new
initialize;
yourself
]
<category: 'VisualGST-Widget'>
| activeWidget widgets widgetEvents paned |
initialize [
<category: 'initialization'>
paned := GTK.GtkNotebook new
setTabPos: GTK.Gtk gtkPosBottom;
show;
"connectSignal: 'switch-page' to: self selector: #'switchPageOn:page:number:';"
yourself.
self mainWidget: paned.
widgetEvents := Dictionary new.
activeWidget := GtkAbstractConcreteWidget new.
widgets := OrderedCollection new.
]
add: aGtkWidget labeled: aString [
<category: 'notebook'>
paned appendPage: aGtkWidget mainWidget show tabLabel: (GTK.GtkLabel new: aString).
widgets add: aGtkWidget
]
addAll: anArray [
<category: 'notebook'>
anArray do: [ :each | self add: each key labeled: each value ]
]
hideTabs [
<category: 'notebook'>
self mainWidget setShowTabs: false
]
show: anIndex [
<category: 'notebook'>
self mainWidget setCurrentPage: anIndex - 1.
activeWidget := (widgets at: anIndex)
yourself
]
panedOrientation [
<category: 'accessing'>
^ self subclassResponsibility
]
switchPageOn: aGtkNotebook page: aGtkNotebookPage number: anInteger [
<category: 'notebook events'>
widgetEvents at: (aGtkNotebook getNthPage: anInteger) ifPresent: [ :msg | msg value: (aGtkNotebook getNthPage: anInteger) ]
]
whenWidgetIsVisible: aGtkWidget send: aSymbol to: anObject [
<category: 'notebook events'>
widgetEvents at: aGtkWidget put: (DirectedMessage receiver: anObject selector: aSymbol arguments: #())
]
]
Jump to Line
Something went wrong with that request. Please try again.