| 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, oloch, Pretoriano, pycage, qole, qwerty12, rcull, Richrd, sixwheeledbeast, Slocan, strank, Thor, timsamoff, twaelti, v13, venient, wreckgar23, xorbit, yerga, ymb, YoDude, ysss, zaheerm | ||
|
|
09-22-2009
, 02:03 AM
|
|
|
Posts: 2,892 |
Thanked: 2,634 times |
Joined on Oct 2005
@ Germany
|
#3
|

|
|
09-22-2009
, 02:23 AM
|
|
|
Moderator |
Posts: 7,070 |
Thanked: 8,589 times |
Joined on Oct 2007
@ Vancouver, BC, Canada
|
#4
|
| The Following 2 Users Say Thank You to qole For This Useful Post: | ||
|
|
09-22-2009
, 06:40 AM
|
|
|
Posts: 1,311 |
Thanked: 3,735 times |
Joined on Sep 2007
@ Vienna, Austria
|
#5
|
|
|
09-22-2009
, 11:58 AM
|
|
|
Super Moderator |
Posts: 1,605 |
Thanked: 1,594 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: | ||
|
|
09-22-2009
, 12:30 PM
|
|
|
Posts: 635 |
Thanked: 277 times |
Joined on Sep 2009
@ Black Mesa Research Facility
|
#7
|
|
|
09-24-2009
, 08:54 AM
|
|
|
Posts: 1,311 |
Thanked: 3,735 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, oloch, pelago, qole, range, Texrat, timsamoff, twaelti, v13, yerga, YoDude | ||
|
|
09-24-2009
, 06:57 PM
|
|
|
Posts: 1,589 |
Thanked: 714 times |
Joined on Aug 2009
@ Arlington (DFW), Texas
|
#9
|
|
|
09-24-2009
, 07:11 PM
|
|
|
Posts: 2,869 |
Thanked: 1,779 times |
Joined on Jan 2007
@ PHL
|
#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 |
| Thread Tools | Search this Thread |
|
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: