View Single Post
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#6
Originally Posted by danielwilms View Post
why aren't you using a gtk button, and set the size like:

Code:
     button = gtk.Button()
     button.set_size_request(200,200)
if you don't specify the size, then it will be set automatically. Or try HILDON_SIZE_AUTO?
For that button, the themeing would be wrong (it would look "flat").

HangLoose: Try having a VBox as "container" and set its size to a bigger value than the button using set_size_request, and then add the container to the widget (self.add(container)) and after that add the button (with the same constructor as in your initial post) to the VBox with "pack_start" and expand set to False. Here are two examples using a normal window (the first is the "bad" one, and the second is the "good" one):

Code:
import gtk
import hildon

w = hildon.StackableWindow()
w.connect('destroy', gtk.main_quit)

b = hildon.Button(gtk.HILDON_SIZE_THUMB_HEIGHT,
                  hildon.BUTTON_ARRANGEMENT_VERTICAL)
b.set_title('Bla')
b.set_value('Blubb')
w.add(b)
w.show_all()
gtk.main()
Adding the VBox:

Code:
import gtk
import hildon

w = hildon.StackableWindow()
w.connect('destroy', gtk.main_quit)

b = hildon.Button(gtk.HILDON_SIZE_THUMB_HEIGHT,
                  hildon.BUTTON_ARRANGEMENT_VERTICAL)
b.set_title('Bla')
b.set_value('Blubb')
vb = gtk.VBox()
w.add(vb)
vb.pack_start(b, expand=False)
w.show_all()
gtk.main()
By the way, you should specify either HILDON_SIZE_THUMB_HEIGHT or HILDON_SIZE_FINGER_HEIGHT, but not both (the thumb height is a little bigger than the finger height).
 

The Following 4 Users Say Thank You to thp For This Useful Post: