resize widget size

This commit is contained in:
antoine 2016-07-23 18:51:12 +02:00
parent b69626d0ec
commit 5909b62ce8
5 changed files with 18 additions and 13 deletions

View File

@ -1,7 +1,6 @@
#:kivy 1.0
<guiApp>:
width: 400
Button:
id: prev

View File

@ -2,14 +2,18 @@
from ..VDM import VDM
import os
import i3
from kivy.config import Config
Config.set('graphics','resizable',0)
from kivy.core.window import Window
Window.size = (600, 150)
import kivy
import i3
from kivy.app import App
from kivy.properties import *
from kivy.uix.gridlayout import GridLayout
class guiApp(GridLayout):
""" display all vdm into kivy interface """
@ -22,17 +26,14 @@ class guiApp(GridLayout):
def __init__(self, **kwargs):
super(guiApp, self).__init__(**kwargs)
from kivy.config import Config
Config.set('graphics', 'width', '600')
from kivy.core.window import Window
self._keyboard = Window.request_keyboard(self._keyboard_closed, self)
self._keyboard.bind(on_key_down = self._on_keyboard_down)
i3.msg("command", "floating enable")
self.v = VDM()
self.vdm = self.v.get()
self.render()
i3.msg("command", "floating enable")
def _nextAction(self):
if self.indice == len(self.vdm)-1:
@ -62,7 +63,6 @@ class guiApp(GridLayout):
print(self.indice)
self.ids["Message"].text = self.vdm[self.indice]
class kivyApp(App):
def build(self):
return guiApp(cols=3)

View File

@ -24,7 +24,13 @@ class VDM(object):
else:
print("Error {}".format(r.status_code))
except ConnectionError as e:
print("Connection error {}".format(e))
except requests.exceptions.ConnectionError as e:
raise errorVDM("network error")
except HTTPError as e:
raise errorVDM("HTTP Error")
class errorVDM(Exception):
def __init__(self, message):
super(errorVDM, self).__init__(message)

Binary file not shown.

Binary file not shown.