|
2011-11-25
, 17:37
|
Posts: 324 |
Thanked: 371 times |
Joined on Dec 2009
@ Vancouver, BC
|
#2
|
The Following User Says Thank You to Slocan For This Useful Post: | ||
|
2011-11-25
, 18:29
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#3
|
import gtk import hildon def main(): program = hildon.Program.get_instance() win = hildon.StackableWindow() win.set_title("test") button = hildon.Button(gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_VERTICAL) button.set_text("some text", "some value") box = gtk.VBox(False, 0) box.pack_start(button, False, False, 0) win.add(box) win.show_all() gtk.main() if __name__ == "__main__": main()
The Following User Says Thank You to nicolai For This Useful Post: | ||
|
2011-11-25
, 19:03
|
|
Posts: 1,918 |
Thanked: 3,118 times |
Joined on Oct 2010
@ My pants
|
#4
|
Put your button into a container, which does not stretch the
child widgets, gtk.VBox for example:
Code:import gtk import hildon def main(): program = hildon.Program.get_instance() win = hildon.StackableWindow() win.set_title("test") button = hildon.Button(gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_VERTICAL) button.set_text("some text", "some value") box = gtk.VBox(False, 0) box.pack_start(button, False, False, 0) win.add(box) win.show_all() gtk.main() if __name__ == "__main__": main()
|
2011-11-25
, 19:13
|
|
Posts: 1,918 |
Thanked: 3,118 times |
Joined on Oct 2010
@ My pants
|
#5
|
import gtk
import hildon
def show_new_window(widget):
win = hildon.StackableWindow()
# ... configure new window
win.show_all()
def main():
program = hildon.Program.get_instance()
win = hildon.StackableWindow()
win.set_title("Main window")
# ... add some widgets to the window
button = hildon.Button(gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT,
hildon.BUTTON_ARRANGEMENT_VERTICAL)
button.set_text("Some title", "some value")
image = gtk.image_new_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_BUTTON)
button.set_image(image)
button.set_image_position(gtk.POS_RIGHT)
button.connect("clicked", show_new_window)
win.add(button)
win.connect("destroy", gtk.main_quit, None)
# This call show the window and also add the window to the stack
win.show_all()
gtk.main()
if __name__ == "__main__":
main()
[NITDroid] [My Qtlockscreen Skins] [QBW HTC Sense on Your N900!] [CPU Power Control] [Debian Packaging] [Build Me!]
Youtube Channel - Subscribe!
Retired Dev - Thanks for all the fish!