Comments (10)
You can obtain and close all windows with:
(let ((windows (mapcar (lambda (ptr)
(gobj:pointer-object ptr 'window))
(glib:glist-list (application-windows gio:*application*)))))
(mapc #'window-destroy windows))
Having closed all windows, the application quits automatically. Also, you may use (gtk::destroy-all-windows-and-quit)
, which is currently internal and can get changed or removed in the future, however.
from cl-gtk4.
READ error during LOAD:
Symbol "GLIST-LIST" not found in the GLIB package.
Line: 661, Column: 94, File-Position: 25012
from cl-gtk4.
I use my fork of your project, could that be a problem?
https://github.com/bigos/cl-gtk4
from cl-gtk4.
(gir:invoke (glib:*ns* "List" 'foreach)
(gtk4:application-windows app)
#'gtk4:window-close
nil)
This approach did not work.
I also tried to add wrappers for glib, but they do not expose all the symbols I need.
When I read
/usr/share/gir-1.0/GLib-2.0.gir
and search for g_list_foreach
I get the impression that the symbols are not introspectable. Do you have any suggestions on how to solve it?
from cl-gtk4.
Could that be a solution?
(loop for aw = (gtk4:application-active-window app)
until (null aw)
do (gtk4:window-close aw))
from cl-gtk4.
I use my fork of your project, could that be a problem?
Please update cl-gobject-introspection-wrapper, cl-glib, and cl-gtk4 to the latest Git version, where I added some new APIs a few days ago.
from cl-gtk4.
I get the impression that the symbols are not introspectable. Do you have any suggestions on how to solve it?
Although they cannot be introspected via GIR, they are accessible through CFFI. The latest cl-glib
provides glist-list
, by which you can convert a GLib.List
to a list in Lisp: https://github.com/bohonghuang/cl-glib/blob/84b128192d6b11cf03f1150e474a23368f07edff/glib/glist.lisp#L179
from cl-gtk4.
Could that be a solution?
I may not recommend this method, since it's not guaranteed that window-close
affects application-active-window
in one event loop, especially when you attach a custom handler to the close-request
signal for a window.
from cl-gtk4.
I get the impression that the symbols are not introspectable. Do you have any suggestions on how to solve it?
Although they cannot be introspected via GIR, they are accessible through CFFI. The latest
cl-glib
providesglist-list
, by which you can convert aGLib.List
to a list in Lisp: https://github.com/bohonghuang/cl-glib/blob/84b128192d6b11cf03f1150e474a23368f07edff/glib/glist.lisp#L179
That is the nice response I was looking for. I thought about it as well, but my CFFI skills are very limited and I could not translate CFFI manual to the case I was working on. Your example taught me how to solve those problems where I encounter gir imperfections. Thank you very much!
from cl-gtk4.
You are welcome.
from cl-gtk4.
Related Issues (20)
- Can't make a GStream binding. HOT 1
- Typelib file for namespace 'Gtk', version '4.0' not found HOT 4
- How to make a GListStore of fixnums / How to subclass GObject HOT 2
- Library needs more documentation HOT 1
- Can't create simple application. HOT 4
- FLOATING-POINT-INVALID-OPERATION HOT 5
- arithmetic error DIVISION-BY-ZERO signalled HOT 2
- Cant create wigets to store it in variable HOT 1
- When vertically scaling the window, there is an artifact with the buttons. HOT 1
- No symbol named "POINTER-OBJECT" HOT 2
- Error g_error_free on Windows 11 HOT 6
- Can't properly pass "user_data" to callback for open file dialog HOT 2
- Support for Subclassing? HOT 1
- Radio buttons HOT 1
- Connect widget to key-pressed event HOT 3
- Can I create my own widgets? HOT 2
- (ql:quickload :cl-gtk4) fails, many issues: HOT 3
- Hoping for examples or documents about dialogs HOT 2
- Making executable HOT 2
- cl-gtk4 not working under SBCL v2.4.5 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cl-gtk4.