pharo-spec / gtk-bindings Goto Github PK
View Code? Open in Web Editor NEWGtk3 bindings for Pharo
Gtk3 bindings for Pharo
Hi I have tried on
brew install gtk+3
curl https://get.pharo.org/64/100+vm | bash
./pharo-ui Pharo.image
Then
Metacello new
repository: 'github://pharo-spec/gtk-bindings';
baseline: 'Gtk';
onConflict: [ :e | e useIncoming ];
onUpgrade: [ :e | e useIncoming ];
ignoreImage;
load.
GEngine ensureRunning.
GtkRunLoop defer: [
GtkWindow new
title: 'Gtk3 Window';
add: (GtkBox newVertical
packStart: (GtkLabel newLabel: 'Hello!');
yourself);
showAll ]
And I have this error
system macOs, monterey m1 pro
External objects are being created without being sent initialize to make them auto release.
See senders of:
pango_cairo_create_layout: cr
pango_layout_new: context
pango_ft2_font_map_create_context
Please note I don't use the Gtk bindings directly, but the Pango predecessor https://github.com/estebanlm/pharo-pango. It looks like these methods haven't changed, so thought I'd bring it to your attention.
Cheers,
Stew
On Windows, when a content is pasted into the GtkEntry using a keybaord shortcut (Ctrl+V), some older windows content is used. Pasting from a context menu works as expected and then pasting using the keyboard uses that clipboard content.
test2
into the clipboardtest3
into the clipboardtest2
test2
test3
super strange... maybe a general Gtk bug? Multiline text input works normally with keyboard
Hi, when executing the installation script it fails as the class GdkTLibrary doesn't exist when creating traits.
Please find screen shot attached and stack trace below.
Note that I used the recommended scripts to install Pharo and Gtk+3 via homebrew.
I'm running Monterey on a Mac M1.
Cheers,
Stew
UndefinedObject(Object)>>doesNotUnderstand: #asTraitComposition
UndefinedObject>>doesNotUnderstand: #asTraitComposition
MCClassDefinition>>traitCompositionCompiled
[ :builder |
builder
superclass: superClass;
name: name;
layoutClass: (ObjectLayout layoutForType: type);
slots: self instanceVariables;
sharedVariables: self classVariables;
sharedPools: self sharedPoolsString;
classSlots: self classInstanceVariables;
traitComposition: self traitCompositionCompiled;
classTraitComposition: self classTraitCompositionCompiled;
comment: comment stamp: commentStamp;
category: category;
environment: superClass environment ] in [ Smalltalk classInstaller
make: [ :builder |
builder
superclass: superClass;
name: name;
layoutClass: (ObjectLayout layoutForType: type);
slots: self instanceVariables;
sharedVariables: self classVariables;
sharedPools: self sharedPoolsString;
classSlots: self classInstanceVariables;
traitComposition: self traitCompositionCompiled;
classTraitComposition: self classTraitCompositionCompiled;
comment: comment stamp: commentStamp;
category: category;
environment: superClass environment ] ] in MCClassDefinition>>createClass in Block: [ :builder | ...
ShiftClassInstaller>>make:
ShiftClassInstaller class>>make:
[ Smalltalk classInstaller
make: [ :builder |
builder
superclass: superClass;
name: name;
layoutClass: (ObjectLayout layoutForType: type);
slots: self instanceVariables;
sharedVariables: self classVariables;
sharedPools: self sharedPoolsString;
classSlots: self classInstanceVariables;
traitComposition: self traitCompositionCompiled;
classTraitComposition: self classTraitCompositionCompiled;
comment: comment stamp: commentStamp;
category: category;
environment: superClass environment ] ] in MCClassDefinition>>createClass in Block: [ Smalltalk classInstaller...
FullBlockClosure(BlockClosure)>>on:do:
MCClassDefinition>>createClass
MCClassDefinition>>load
MCClassDefinition(MCDefinition)>>addMethodAdditionTo:
[ :each | each addMethodAdditionTo: methodAdditions ] in MCPackageLoader>>basicLoadDefinitions in Block: [ :each | each addMethodAdditionTo: methodAddition...etc...
[ :each | | newLabel |
"Special handling for first and last element"
(count = 0 or: [ count + 1 = size or: [(Time millisecondsSince: lastUpdate) >= msecs]])
ifTrue: [
bar current: count.
oldLabel = (newLabel := (labelBlock cull: each) ifNil: [oldLabel])
ifFalse: [
bar label: newLabel.
oldLabel := newLabel ].
lastUpdate := Time millisecondClockValue ].
aBlock value: each.
count := count + 1 ] in [:bar |
labelBlock := aStringOrBlock isString
ifTrue: [
bar label: aStringOrBlock.
[ :dummyItem | aStringOrBlock] ]
ifFalse: [ aStringOrBlock ].
self do: [ :each | | newLabel |
"Special handling for first and last element"
(count = 0 or: [ count + 1 = size or: [(Time millisecondsSince: lastUpdate) >= msecs]])
ifTrue: [
bar current: count.
oldLabel = (newLabel := (labelBlock cull: each) ifNil: [oldLabel])
ifFalse: [
bar label: newLabel.
oldLabel := newLabel ].
lastUpdate := Time millisecondClockValue ].
aBlock value: each.
count := count + 1 ] ] in OrderedCollection(Collection)>>do:displayingProgress:every: in Block: [ :each | | newLabel |...
OrderedCollection>>do:
[:bar |
labelBlock := aStringOrBlock isString
ifTrue: [
bar label: aStringOrBlock.
[ :dummyItem | aStringOrBlock] ]
ifFalse: [ aStringOrBlock ].
self do: [ :each | | newLabel |
"Special handling for first and last element"
(count = 0 or: [ count + 1 = size or: [(Time millisecondsSince: lastUpdate) >= msecs]])
ifTrue: [
bar current: count.
oldLabel = (newLabel := (labelBlock cull: each) ifNil: [oldLabel])
ifFalse: [
bar label: newLabel.
oldLabel := newLabel ].
lastUpdate := Time millisecondClockValue ].
aBlock value: each.
count := count + 1 ] ] in OrderedCollection(Collection)>>do:displayingProgress:every: in Block: [:bar |...
FullBlockClosure(BlockClosure)>>cull:
[ ^ block cull: self ] in [ self prepareForRunning.
CurrentJob value: self during: [ ^ block cull: self ] ] in Job>>run in Block: [ ^ block cull: self ]
[ activeProcess
psValueAt: index
put: anObject.
aBlock value ] in CurrentJob(DynamicVariable)>>value:during: in Block: [ activeProcess...
FullBlockClosure(BlockClosure)>>ensure:
CurrentJob(DynamicVariable)>>value:during:
CurrentJob class(DynamicVariable class)>>value:during:
[ self prepareForRunning.
CurrentJob value: self during: [ ^ block cull: self ] ] in Job>>run in Block: [ self prepareForRunning....
FullBlockClosure(BlockClosure)>>ensure:
Job>>run
MorphicUIManager(UIManager)>>displayProgress:from:to:during:
ByteString(String)>>displayProgressFrom:to:during:
OrderedCollection(Collection)>>do:displayingProgress:every:
OrderedCollection(Collection)>>do:displayingProgress:
MCPackageLoader>>basicLoadDefinitions
[self basicLoadDefinitions] in MCPackageLoader>>basicLoad in Block: [self basicLoadDefinitions]
Ok, maybe I broke it myself, by just copying (but not overwriting existing files) into the dir where PharoLauncher downloads the VM (11, x64).
That sorta worked, but some symbol was not found in some DLL (and every update of VM would've deleted the GTK).
Then I remembered that I had an x64 Gtk3 installer (slightly less messy than copying it out from MSYS2 yourself).
I fired it up, let it add the dir into PATH, and et-voila, gtk-bindings & spec-gtk work with the default P11/x64 VM managed by PharoLauncher.
the binaries I used are from: https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases (used the last version from 2022).
Perhaps combo of stock VM + system-wide GTK3 install could also be recommended in README ? Or does the default VM lack something vital ?
I see that the Pharo-Mars code has been split into two projects. Unfortunately this has still not fixed the problem with Ubuntu. It is still totally impossible to run pharo mars on ubuntu.
Just loading the GTK-bindings package into ubuntu causes a segfault.
Xubuntu 20.04 64-bit - I followed the instructions on gtk-bindings readme page.
Crash report attached
crash.txt
('GObject-Base' referencing 'Gtk-Base')
This happens in GRunLoop class>>#current
:
current
^ GtkEngine current runLoop
I see two possible fixes:
^ GEngine current runLoop
current
to GtkRunLoop
and place a ^ self subclassResponsability
in GRunLoop
.I've installed image as recommended for Linux. Then I tried to run the testing code and ended with error Unknown variable: GtkApplication
.
Investigating code a little bit further reveals that GtkRunLoop does not have defer
class method anymore. So I guess, README needs a bit of fixing to bring it up to date to the current code.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.