On Sun, 11 Nov 2012, Syn wrote:
# Ah, Yes thanks,
#
# This is the code I am using
# from kivy.config import Config
# Config.set('graphics','resizable',0)
#
# Even with this code, the window will still be resizable
# However it is interesting that, the window becomes non-resizable after I resize it the first time.
#
# Do you know how this can be fixed? It looks like I may have to 'force' a resize somehow.
This is one of those 'gotchas' for Kivy; the whole 'config' class
is rendered useless from the application side due to how it works.
Perhaps we can add the below clip to the documentation, since I'm
sure it trips up a lot of people (ie: a number of things trip you up when
you first join kivy-land :)
- user-wide config file (not per-app) is not what you would expect
- config settings that are taken from the file and Config.set...
doesn't work.. gotcha!
- command line processing is also neutered, with no Kivy-friendly
way to extend it .. Kivy expects to manage args, and only the ones it
wants. (In a cross platform toolkit, this is pretty strange.. it shows the
tablet-centric origins of the framework.)
.. but you can work around all this, easily.
(we should patch Kivy really.. add a few flags to let command line
override config settings, and command line extensions for apps.. not hard
really.)
- first, you can take command line arguments; just remove them
from argv[] before kivy sees them, or it will complain and bail out; or
reset them if you're done..
- second, as soon as kivy gets pulled in at all, it'll eat up that
config file, rather than later; so you need to override it right away,
before anything else, before your kivy-app starts
This works:
sys.argv = [ sys.argv[0] ] # so we can have command line
import kivy
kivy.require('1.4.0')
# override config values, no easy way to do it :/
kivy.config.Config.set ( 'graphics', 'width', state.window_width )
kivy.config.Config.set ( 'graphics', 'height', state.window_height )
from
kivy.app import App
.. etc ..
jeff
--
If everyone would put barbecue sauce on their food, there would be no war.