Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8903709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:56:15+00:00 2026-06-15T01:56:15+00:00

I have this program and, as much as I try I can not make

  • 0

I have this program and, as much as I try I can not make the elements expand to occupy the area defined for the tire size of the application.

Code:

import smtpClass
import xmlHostes
import pygtk
pygtk.require('2.0')
import gtk



class Base:

def get_main_menu(self, window):
    accel_group = gtk.AccelGroup()
    item_factory = gtk.ItemFactory(gtk.MenuBar, "<main>", accel_group)
    item_factory.create_items(self.menu_items)
    window.add_accel_group(accel_group)
    self.item_factory = item_factory
    return item_factory.get_widget("<main>")

def __init__(self):

    ## MENU CONTENT
    self.menu_items = (#  MENU TREE      # CONTROL KEY   # FUNCTION
                       ( "/_File",          None,         None,             0,  "<Branch>" ),
                       ( "/File/_Setings",  "<control>S", None,             0,  None ),
                       ( "/File/Quit",      "<control>Q", gtk.main_quit,    0,  None ),
                       ( "/_Help",          None,         None,             0,  "<LastBranch>" ),
                       ( "/_Help/About",    None,         None,             0,  None ),
                       )


    # WINDOW WIDGET
    self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
    self.window.set_title("pyAnonMail")
    self.window.set_size_request(500, 500)

    # CONTEINER DATA
    main_vbox = gtk.VBox(False, 5)
    #main_vbox.set_border_width(1)
    self.window.add(main_vbox)
    main_vbox.show()

    self.contentTable = gtk.Table(1, 3, True)
    main_vbox.pack_start(self.contentTable, True, True, 10)

    # ADD MENU TO CONTEINER
    self.menubar = self.get_main_menu(self.window)
    main_vbox.add(self.menubar)
    self.menubar.show()

    # FRAME 1 ##########################################################
    self.frame1 = gtk.Frame()
    self.contentTable.attach(self.frame1, 0, 1, 0, 1,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    self.frame1.set_label_align(0.0, 0.0)
    self.frame1.set_label("Enter message data")
    self.frame1.set_shadow_type(gtk.SHADOW_ETCHED_OUT)
    self.frame1.show()


    # DATA TABLE

    dataTable = gtk.Table(2, 6, False)
    self.frame1.add(dataTable)
    dataTable.show()

    senderNameFrame = gtk.Label("Sender Name:")
    dataTable.attach(senderNameFrame, 0, 1, 0, 1,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    senderNameFrame.show()
    senderNameEntry = gtk.Entry()
    dataTable.attach(senderNameEntry, 0, 1, 1, 2,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    senderNameEntry.show()

    senderEmailFrame = gtk.Label("Sender Email:")
    dataTable.attach(senderEmailFrame, 1, 2, 0, 1,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    senderEmailFrame.show()
    senderEmailEntry = gtk.Entry()
    dataTable.attach(senderEmailEntry, 1, 2, 1, 2,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    senderEmailEntry.show()

    recipientNameFrame = gtk.Label("Recipient Name:")
    dataTable.attach(recipientNameFrame, 0, 1, 2, 3,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    recipientNameFrame.show()
    recipientNameEntry = gtk.Entry()
    dataTable.attach(recipientNameEntry, 0, 1, 3, 4,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    recipientNameEntry.show()

    recipientEmailFrame = gtk.Label("Recipient Email:")
    dataTable.attach(recipientEmailFrame, 1, 2, 2, 3,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    recipientEmailFrame.show()
    recipientEmailEntry = gtk.Entry()
    dataTable.attach(recipientEmailEntry, 1, 2, 3, 4,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    recipientEmailEntry.show()

    dataAndTimeFrame = gtk.Label("Data and Time:")
    dataTable.attach(dataAndTimeFrame, 0, 1, 4, 5,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    dataAndTimeFrame.show()
    dataAndTimeEntry = gtk.Entry()
    dataTable.attach(dataAndTimeEntry, 1, 2, 4, 5,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    dataAndTimeEntry.show()

    subjectFrame = gtk.Label("Subject:")
    dataTable.attach(subjectFrame, 0, 1, 5, 6,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    subjectFrame.show()
    subjectEntry = gtk.Entry()
    dataTable.attach(subjectEntry, 1, 2, 5, 6,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    subjectEntry.show()

    ####################################################################

    # FRAME 2 ##########################################################
    self.frame2 = gtk.Frame()
    self.contentTable.attach(self.frame2,0,1,1,2,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    self.frame2.set_label_align(0.0, 0.0)
    self.frame2.set_label("Enter message body")
    self.frame2.set_shadow_type(gtk.SHADOW_ETCHED_OUT)
    self.frame2.show()

    table = gtk.ScrolledWindow()
    table.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
    text = gtk.TextView()
    text.set_editable(True)
    textbuffer = text.get_buffer()
    self.frame2.add(table)
    table.show()
    table.add(text)
    text.show()



    ####################################################################

    # FRAME 3 ##########################################################
    self.frame3 = gtk.Frame()
    self.contentTable.attach(self.frame3,0,1,2,3,
        gtk.FILL, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    self.frame3.set_label_align(0.0, 0.0)
    self.frame3.set_label("Select attached files")
    self.frame3.set_shadow_type(gtk.SHADOW_ETCHED_OUT)
    self.frame3.show()

    ####################################################################

    self.contentTable.show()

    self.window.show()

def main(self):
    gtk.main()

def destroy(self, widget, data=None):
    gtk.main_quit()

I thought the problem was in the gtk.box parameters, or the parameters of gtk.tables. I’ve tried everything and nothing changes.
In the examples I find on the net about gtk and python, everything is as I have but the result is always different from mine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:56:16+00:00Added an answer on June 15, 2026 at 1:56 am

    You have to add gtk.EXPAND to the xoptions parameter when calling contentTable.attach:

    # FRAME 1 ##########################################################
    self.frame1 = gtk.Frame()
    self.contentTable.attach(self.frame1, 0, 1, 0, 1,
    gtk.FILL | gtk.EXPAND, gtk.EXPAND | gtk.SHRINK | gtk.FILL, 0, 0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this program in Python which should save text files to a folder
I have this program that should execute a piece of code base on the
I have this program, but cin in randomly skips.. I mean sometimes it does,
I have this program that I am working on for class, I think the
Alright, I have this program to sparse code in Newick Format, which extracts both
note: I am sorry if this is a stupid question! I have this program
I have this simple program that computes salaries for four different worker types. It's
I have this function: Program A public ICollection<ReportLocationInfo> GetAllReportsInstalled() { return _Reports; } I
I have this servlet program and an external .jar file (written by someone else)
I have this C++ program: int box[9][9]; box = { {solution[0][0],solution[0][1],solution[0][2],solution[1][0],solution[1][1],solution[1][2],solution[2][0],solution[2][1],solution[2][2]}, {solution[0][3],solution[0][4],solution[0][5],solution[1][3],solution[1][4],solution[1][5],solution[2][3],solution[2][4],solution[2][5]}, {solution[0][6],solution[0][7],solution[0][8],solution[1][6],solution[1][7],solution[1][8],solution[2][6],solution[2][7],solution[2][8]}, {solution[3][0],solution[3][1],solution[3][2],solution[4][0],solution[4][1],solution[4][2],solution[5][0],solution[5][1],solution[5][2]},

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.