GUI/Maximum window dimensions: Difference between revisions
Content added Content deleted
m (Keep only Gtk2) |
|||
Line 767: | Line 767: | ||
main()</lang> |
main()</lang> |
||
{{out}} |
|||
<pre>W x H = 1920 x 1031</pre> |
|||
===With Gtk3 (gintro)=== |
|||
{{libheader|gintro}} |
|||
This is the translation of Gtk2 program to Gtk3 using “gintro” bindings. |
|||
<lang Nim>import gintro/[glib, gobject, gtk, gio] |
|||
var window: ApplicationWindow |
|||
#--------------------------------------------------------------------------------------------------- |
|||
proc printSize(data: pointer): gboolean {.cdecl.} = |
|||
var width, height: int |
|||
window.getSize(width, height) |
|||
echo "W x H = ", width, " x ", height |
|||
window.destroy() |
|||
#--------------------------------------------------------------------------------------------------- |
|||
proc activate(app: Application) = |
|||
## Activate the application. |
|||
window = app.newApplicationWindow() |
|||
window.maximize() |
|||
window.showAll() |
|||
discard timeoutAdd(PRIORITY_DEFAULT, 100, SourceFunc(printSize), nil, nil) |
|||
#——————————————————————————————————————————————————————————————————————————————————————————————————— |
|||
let app = newApplication(Application, "Rosetta.ScreenSize") |
|||
discard app.connect("activate", activate) |
|||
discard app.run()</lang> |
|||
{{out}} |
{{out}} |
||
<pre>W x H = 1920 x 1031</pre> |
<pre>W x H = 1920 x 1031</pre> |