Example #1
0
def initial_resize():
	"""SDL insists that you must give your new window some size
	(screen_surface = pygame.display.set_mode), it ignores the WM
	but if the WM takes over...it doesnt even realize it!
	so it thinks it has the original size
	so i try to get the actual window size and "resize" """
	resize((666,666))
	try:
		w = pygame.display.get_wm_info()["wmwindow"]
		import subprocess
		x =  subprocess.check_output(["xwininfo", "-id", str(w)]).decode()
		y = x.splitlines()
		for l in y:
			s = l.split()
			if len(s) > 1:
				if s[0] == "Width:":
					w = int(s[1])
				if s[0] == "Height:":
					h = int(s[1])
		resize((w, h))
	except Exception as e:
		info("%s, failed to work around stupid sdl, will continue thinking the window is 666x666, please do a manual resize", e)
Example #2
0
from types import SimpleNamespace

from lemon_utils.lemon_six import iteritems, unicode
from lemon_utils.dotdict import Dotdict
from lemon_utils.lemon_logging import info,log
from lemon_args import args


try:
	#im gonna have to ditch this crappy module
	from colors import *
	assert rgb,  'we imported some outdated .pyc or something'
except ImportError as e:
	info("%s, ...but nevermind", e)


class ColorsSettings():
	def __init__(s):
		s.info_item_text = (224,224,224)
		s.bg = (0,0,0)
		s.highlighted_bg = (40,0,0)
		s.arrow = (150,150,111)
		s.fg = (255,255,255)
		s.cursor = (155,255,255)
		s.info_item_visibility_toggle = (100,100,100)
		s.menu_rect_selected = (255,255,255)
		s.menu_rect = (0,0,255)
		s.help = (255,255,0)
		s.parser_hint = (100,100,100)
		s.text_brackets = (0,255,0)
		s.compiler_brackets = (255,255,0)