The Following 41 Users Say Thank You to thp For This Useful Post: | ||
allnameswereout, attila77, bocaJ, BrentDC, Corwin, cpscotti, daperl, eber42, eiffel, fatalsaint, frals, Helmuth, iKneaDough, jcharpak, jukey, Khertan, ldrn, linuxeventually, mikec, Pretoriano, pycage, qole, qwerty12, rcull, Richrd, sixwheeledbeast, Slocan, strank, Thor, timsamoff, twaelti, v13, wreckgar23, xorbit, yerga, ymb, YoDude, ysss, zaheerm |
|
2009-09-22
, 06:03
|
|
Posts: 3,404 |
Thanked: 4,474 times |
Joined on Oct 2005
@ Germany
|
#3
|
|
2009-09-22
, 06:23
|
|
Moderator |
Posts: 7,109 |
Thanked: 8,820 times |
Joined on Oct 2007
@ Vancouver, BC, Canada
|
#4
|
The Following 2 Users Say Thank You to qole For This Useful Post: | ||
|
2009-09-22
, 10:40
|
|
Posts: 1,391 |
Thanked: 4,272 times |
Joined on Sep 2007
@ Vienna, Austria
|
#5
|
|
2009-09-22
, 15:58
|
|
Posts: 1,605 |
Thanked: 1,601 times |
Joined on Mar 2007
@ Southern California
|
#6
|
Heh, 3 months after N900 sales start, Nokia will think that nobody cares about rotation anymore. But the truth will be that everyone will be using community apps that do the same thing and that have auto-rotation built-in...
The Following User Says Thank You to timsamoff For This Useful Post: | ||
|
2009-09-22
, 16:30
|
|
Posts: 635 |
Thanked: 282 times |
Joined on Sep 2009
@ Black Mesa Research Facility
|
#7
|
|
2009-09-24
, 12:54
|
|
Posts: 1,391 |
Thanked: 4,272 times |
Joined on Sep 2007
@ Vienna, Austria
|
#8
|
main_window = .... # set this to your main window rotation = FremantleRotation(main_window) # we're in auto-rotation mode now rotation.set_mode(FremantleRotation.ALWAYS) # we're now forcing portrait mode rotation.set_mode(FremantleRotation.NEVER) # we're now forcing landscape mode rotation.set_mode(FremantleRotation.AUTOMATIC) # and automatic mode again # you can also get the mode mode = rotation.get_mode() if mode == FremantleRotation.AUTOMATIC: # do something here elif mode == FremantleRotation.ALWAYS: # something else here elif mode == FremantleRotation.NEVER: # you get the idea...
The Following 14 Users Say Thank You to thp For This Useful Post: | ||
conny, fatalsaint, iKneaDough, noobmonkey, pelago, qole, range, Texrat, timsamoff, twaelti, v13, yerga, YoDude |
|
2009-09-24
, 22:57
|
|
Posts: 1,589 |
Thanked: 720 times |
Joined on Aug 2009
@ Arlington (DFW), Texas
|
#9
|
|
2009-09-24
, 23:11
|
|
Posts: 2,869 |
Thanked: 1,784 times |
Joined on Feb 2007
@ Po' Bo'. PA
|
#10
|
I'm trying to draw support for THIS BRAINSTORM IDEA about Nokia supporting Automatic Screen Rotation in the entire UI of Maemo 5/N900. Please give it a look and give me a hand. I thought since this thread mentioned rotation, maybe someone might be interested.
Tags |
code, fremantle, howto, portrait mode, python |
|
Now that python-hildon has got support for portrait mode, I've added portrait mode support and auto-rotation to gPodder for Maemo 5, and in order to make my life easier, I've come up with a nice object that you can throw into your own code and that will take care of auto-rotation:
http://repo.or.cz/w/gpodder.git?a=bl...tl/portrait.py
The only thing you (might) need to do is to connect your windows to the configure-event signal and check the ratio of the width and height to determine if you need to relayout your window. For some windows (i.e. a window with just a treeview) you don't need to do anything
Usage: Save the code as "portrait.py" or find some nice place in the module structure of you project, then use something like the following, and you're done: