Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,7 @@
import
gtk2, gdk2
nim_init()
var w = gdk2.screen_width()
var h = gdk2.screen_height()
echo("WxH=",w,"x",h)

View file

@ -0,0 +1,17 @@
import glib2, gtk2
proc printSize(window: PWindow): guint {.cdecl.} =
var width, height: gint
window.get_size(addr(width), addr(height))
echo "W x H = ", width, " x ", height
main_quit()
nim_init()
let window = window_new(WINDOW_TOPLEVEL)
window.maximize()
window.show_all()
discard g_timeout_add(100, printSize, addr(window[]))
main()

View file

@ -0,0 +1,28 @@
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()

View file

@ -0,0 +1,22 @@
import
iup
# assumes you have the iup .dll or .so installed
discard iup.open(nil,nil)
var scrnFullSize = GetGlobal("FULLSIZE")
var scrnSize = GetGlobal("SCREENSIZE")
var scrnMInfo = GetGlobal("MONITORSINFO")
var scrnVScreen = GetGlobal("VIRTUALSCREEN")
var dlg = Dialog(nil)
SetAttribute(dlg, "SIZE", "FULL")
var scrnXSize = GetAttribute(dlg,"MAXSIZE")
echo scrnFullSize, "\n", scrnSize, "\n", scrnMInfo, "\n", scrnVScreen, "\n", scrnXSize
discard iup.Alarm("Screen client size", scrnFullSize ,"Ok",nil, nil)
#discard iup.mainloop()
iup.close()