Skip to content

Instantly share code, notes, and snippets.

@estebanlm
estebanlm / columnview.py
Created April 18, 2025 15:18
A gtkcolumnview example in python
import gi
gi.require_version("Gtk", "4.0")
from gi.repository import Gtk, Gio, GObject
class Person(GObject.GObject):
name = GObject.Property(type=str)
age = GObject.Property(type=int)
def __init__(self, name, age):
super().__init__()
@estebanlm
estebanlm / Test1.st
Created February 20, 2023 09:52
test1
app := SpApplication new.
presenter := SpPresenter newApplication: app.
presenter layout: (SpBoxLayout newTopToBottom).
presenter open.
presenter layout add: (label := presenter newLabel) expand: false.
label label: 'Hello, Cagliari'.
@estebanlm
estebanlm / ShowingAnOverlayWorkingWithMorphicBEtc.st
Created January 6, 2023 12:16
showing an overlay working with morphic backend
app := SpApplication new.
app addStyleSheetFromString: '.application [
.green [
Draw {
#backgroundColor: #16A085
}
],
.redOverlay [
Draw { #backgroundColor: #C0392BBB },
Geometry { #height: 150, #width: 150 }
@estebanlm
estebanlm / ExampleUsageOfSubmitResetAndTextChaEtc.st
Created March 9, 2022 09:14
example usage of submit, reset and text changed events
app := SpApplication new.
"If using Morphic"
app addStyleSheetFromString: '.application [
.dirty [ Container { #borderColor: #red, #borderWidth: 1 } ],
.notDirty [ Container { #borderColor: #transparent, #borderWidth: 1 } ]
]'.
"If using GTK (you need to choose one, both options are not possible at the same time)"
app useBackend: #Gtk.
@estebanlm
estebanlm / SpecApplyingStylesToSpecPresentersBEtc.st
Last active January 25, 2022 22:16
Spec - applying styles to spec presenters (both Morphic and GTK3)
app := SpApplication new.
"If using Morphic"
app addStyleSheetFromString: '.application [
.red [ Draw { #color: #red } ],
.green [ Draw { #color: #green } ]
]'.
"If using GTK (you need to choose one, both options are not possible at the same time)"
app useBackend: #Gtk.
@estebanlm
estebanlm / CollectionExtension.st
Last active October 20, 2021 16:07
Example StInspector complex extension with activation
Collection >> tabInspectorList: builder [
<inspectorPresentationOrder: 90 title: 'Tab View'>
^ StCollectionExampleInspection on: self
]
@estebanlm
estebanlm / ExampleWindowWithoutDecorations.st
Created October 19, 2021 10:25
example window without decorations
presenter := SpPresenter new.
presenter application: (app := SpApplication new).
app styleSheet: (SpStyle defaultStyleSheet, (SpStyleVariableSTONReader fromString: '.application [
.box [ Container { #borderWidth: 10, #borderColor: #FF0000 } ],
.bgGreen [
Draw { #backgroundColor: #00FF00 } ] ]
')).
presenter layout: (SpBoxLayout newTopToBottom).