; Module/File: Monitor_GetPrimNo.pb ; Function: Get the no. of primary monitor - Linux < gtk3.22 ; Author: Omi ; Date: Sep. 03, 2016 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31/5.4 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- EnableExplicit ImportC "" gdk_screen_get_primary_monitor(*screen.GdkScreen) EndImport ; Object constants #MainWin = 0 #Txt = 0 Global.i gEvent, gQuit If OpenWindow(#MainWin, 300, 200, 300, 100, "Show primary monitor no.", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) TextGadget(#Txt, 5, 5, 290, 26, "Primary monitor no.: " + Str(gdk_screen_get_primary_monitor(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