![]() |
2010-11-03
, 14:59
|
Posts: 21 |
Thanked: 0 times |
Joined on Oct 2010
|
#2
|
# Load in pygtk and gtk import pygtk pygtk.require('2.0') import gtk # Define the main window class Whc: def __init__(self): # Window and framework self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("destroy", self.destroy) # A Button, with an action. # Add it to the geometry # show the button self.table = gtk.Table(2, 2, gtk.TRUE) self.button = gtk.Button("First Button1") self.button.connect("clicked", self.hello, None) self.table.attach(self.button, 0, 1, 0, 1) self.button.show() self.button = gtk.Button("First Button2") self.button.connect("clicked", self.hello, None) self.table.attach(self.button, 1, 2, 0, 1) self.button.show() self.button = gtk.Button("xexe") self.button.connect("clicked", self.hello, None) self.table.attach(self.button, 0, 2, 1, 2) self.button.show() self.window.add(self.table) self.table.show() # Show the window self.window.show() # Callback function for use when the button is pressed def hello(self, widget, data=None): print "Sveikas pasauli!" # Destroy method causes appliaction to exit # when main window closed def destroy(self, widget, data=None): gtk.main_quit() # All PyGTK applicatons need a main method - event loop def main(self): gtk.main() if __name__ == "__main__": base = Whc() base.main()
The problem I have is to make the widget area at one size and the buttonlist to be smaller(should just be some icons, so like 64px wide).
At the bottom there should be two buttons, the left button should be much smaller then the right button.
http://img577.imageshack.us/i/layout.png/