; Module/File: Monitor_GetMonitorNum.pb ; Function: Get the number of connected monitors - Linux < gtk3.22 ; Author: Omi ; Date: Sep. 03, 2016 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31/5.4x ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- EnableExplicit ; Object constants #MainWin = 0 #Txt = 0 Global.i gEvent, gQuit If OpenWindow(#MainWin, 300, 200, 300, 100, "Show number of monitors", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) TextGadget(#Txt, 5, 5, 290, 26, "Number of monitors: " + Str(gdk_screen_get_n_monitors_(gdk_screen_get_default_()))) Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True EndSelect Until gQuit EndIf ; IDE Options = PureBasic 5.46 LTS (Linux - x86) ; CursorPosition = 1 ; EnableUnicode ; EnableXP