This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app := SpApplication new. | |
app addStyleSheetFromString: '.application [ | |
.green [ | |
Draw { | |
#backgroundColor: #16A085 | |
} | |
], | |
.redOverlay [ | |
Draw { #backgroundColor: #C0392BBB }, | |
Geometry { #height: 150, #width: 150 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collection >> tabInspectorList: builder [ | |
<inspectorPresentationOrder: 90 title: 'Tab View'> | |
^ StCollectionExampleInspection on: self | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |