Handbook
Glossary
gtk2-ui-backend
Vocabulary
ui
.
backend
.
gtk2
Definition
IN:
ui.backend.gtk2
SINGLETON:
gtk2-ui-backend
Methods
USING:
accessors
gtk2.ffi
kernel
ui.backend
ui.backend.gtk2
ui.event-loop
ui.private
;
M:
gtk2-ui-backend
(close-window)
window>>
[
gtk_widget_destroy
]
[
unregister-window
]
bi
event-loop?
[
gtk_main_quit
]
unless
;
USING:
accessors
gobject.ffi
ui.backend.gtk2
ui.pixel-formats
;
M:
gtk2-ui-backend
(free-pixel-format)
handle>>
g_object_unref
;
USING:
accessors
ui.backend
ui.backend.gtk2
;
M:
gtk2-ui-backend
(fullscreen?)
handle>>
fullscreen?>>
;
USING:
accessors
gdk2.ffi
gtk2.ffi
kernel
ui.backend
ui.backend.gtk2
;
M:
gtk2-ui-backend
(grab-input)
window>>
[
gtk_grab_add
]
[
GDK_BLANK_CURSOR
set-cursor
]
bi
;
USING:
gdk2.gl.ffi
kernel
ui.backend.gtk2
ui.pixel-formats
;
M:
gtk2-ui-backend
(make-pixel-format)
nip
perm-attribs
attrib-table
pixel-format-attributes>int-array
gdk_gl_config_new
;
USING:
accessors
alien.strings
gtk2.ffi
io.encodings.utf8
kernel
sequences
ui.backend
ui.backend.gtk2
ui.private
;
M::
gtk2-ui-backend
(open-window)
( world -- )
GTK_WINDOW_TOPLEVEL
gtk_window_new
:>
win
gtk_drawing_area_new
:>
drawable win drawable
gtk_container_add
gtk_im_multicontext_new
:>
im win drawable im
<window-handle>
world
handle<<
world win
register-window
win world
[
window-loc>>
auto-position
]
[
dim>>
first2
gtk_window_set_default_size
]
2bi
win
"factor"
"Factor"
[
utf8
string>alien
]
bi@
gtk_window_set_wmclass
world
configure-gl
win
events-mask
gtk_widget_add_events
win
gtk_widget_realize
win
connect-user-input-signals
win
connect-win-state-signals
win im
configure-im
world
handle>>
connect-configure-signal
drawable
connect-expose-sigal
win world
window-controls>>
configure-window-controls
win
gtk_widget_show_all
;
USING:
accessors
gtk2.ffi
kernel
ui.backend
ui.backend.gtk2
;
M:
gtk2-ui-backend
(set-fullscreen)
[
handle>>
]
dip
[
>>fullscreen?
]
keep
[
window>>
]
dip
[
gtk_window_fullscreen
]
[
gtk_window_unfullscreen
]
if
;
USING:
accessors
gdk2.ffi
gtk2.ffi
kernel
ui.backend
ui.backend.gtk2
;
M:
gtk2-ui-backend
(ungrab-input)
window>>
[
gtk_grab_remove
]
[
GDK_LEFT_PTR
set-cursor
]
bi
;
USING:
destructors
gtk2.ffi
gtk2.gl.ffi
kernel
ui.backend
ui.backend.gtk2
ui.backend.gtk2.io
ui.private
;
M:
gtk2-ui-backend
(with-ui)
f
f
gtk_init_check
[
"Unable to initialize GTK"
throw
]
unless
f
f
gtk_gl_init
load-icon
init-clipboard
start-ui
[
[
[
gtk_main
]
with-timer
]
with-event-loop
]
with-destructors
;
USING:
gdk2.ffi
ui
ui.backend.gtk2
;
M:
gtk2-ui-backend
beep
gdk_beep
;
USING:
accessors
gtk2.ffi
ui.backend
ui.backend.gtk2
;
M:
gtk2-ui-backend
raise-window*
handle>>
window>>
gtk_window_present
;
USING:
accessors
gtk2.ffi
kernel
sequences
ui
ui.backend.gtk2
;
M:
gtk2-ui-backend
resize-window
[
handle>>
window>>
]
[
first2
]
bi*
gtk_window_resize
;
USING:
accessors
alien.strings
gtk2.ffi
io.encodings.utf8
kernel
ui.backend
ui.backend.gtk2
;
M:
gtk2-ui-backend
set-title
swap
[
handle>>
window>>
]
[
utf8
string>alien
]
bi*
gtk_window_set_title
;
USING:
gtk2.ffi
ui.backend
ui.backend.gtk2
;
M:
gtk2-ui-backend
stop-event-loop
gtk_main_quit
;
USING:
alien.strings
destructors
gtk2.ffi
io.encodings.utf8
kernel
ui
ui.backend.gtk2
;
M::
gtk2-ui-backend
system-alert
( caption text -- )
[
f
GTK_DIALOG_MODAL
GTK_MESSAGE_WARNING
GTK_BUTTONS_OK
caption
utf8
string>alien
f
gtk_message_dialog_new
>k_widget_destroy
[
text
utf8
string>alien
f
gtk_message_dialog_format_secondary_text
]
[
gtk_dialog_run
drop
]
bi
]
with-destructors
;
USING:
environment
kernel
sequences
ui.backend
ui.backend.gtk2
;
M:
gtk2-ui-backend
ui-backend-available?
"DISPLAY"
os-env
empty?
not
;