Active Topics

 


Reply
Thread Tools
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#1
I have been trying to do a layout but have trouble knowing what components I should use. In the widget area, I have three layouts which the buttonlist on the right selects which to show. The widget area is simply some labels and text areas.

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/
 
Posts: 21 | Thanked: 0 times | Joined on Oct 2010
#2
hey here i got example(dont remember the source) of three buttons. in example it uses simple tables to divide window.. u should learn some gtk.

Code:
 
# 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()
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:05.