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

  • SEARCH
  • Home
  • 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 72191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:00:21+00:00 2026-05-10T20:00:21+00:00

I am working on a desktop application in PyGTK and seem to be bumping

  • 0

I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I’ve structured my project this way:

  • application.py – holds the primary application class (most functional routines)
  • gui.py – holds a loosely coupled GTK gui implementation. Handles signal callbacks, etc.
  • command.py – holds command line automation functions not dependent on data in the application class
  • state.py – holds the state data persistence class

This has served fairly well so far, but at this point application.py is starting to get rather long. I have looked at numerous other PyGTK applications and they seem to have similar structural issues. At a certain point the primary module starts to get very long and there is not obvious way of breaking the code out into narrower modules without sacrificing clarity and object orientation.

I have considered making the GUI the primary module and having seperate modules for the toolbar routines, the menus routines, etc, but at that point I believe I will lose most of the benefits of OOP and end up with an everything-references-everything scenario.

Should I just deal with having a very long central module or is there a better way of structuring the project so that I don’t have to rely on the class browser so much?

EDIT I

Ok, so point taken regarding all the MVC stuff. I do have a rough approximation of MVC in my code, but admittedly I could probably gain some mileage by further segregating the model and controller. However, I am reading over python-gtkmvc’s documentation (which is a great find by the way, thank you for referencing it) and my impression is that its not going to solve my problem so much as just formalize it. My application is a single glade file, generally a single window. So no matter how tightly I define the MVC roles of the modules I’m still going to have one controller module doing most everything, which is pretty much what I have now. Admittedly I’m a little fuzzy on proper MVC implementation and I’m going to keep researching, but it doesn’t look to me like this architecture is going to get any more stuff out of my main file, its just going to rename that file to controller.py.

Should I be thinking about separate Controller/View pairs for seperate sections of the window (the toolbar, the menus, etc)? Perhaps that is what I’m missing here. It seems that this is what S. Lott is referring to in his second bullet point.

Thanks for the responses so far.

  • 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. 2026-05-10T20:00:22+00:00Added an answer on May 10, 2026 at 8:00 pm

    In the project Wader we use python gtkmvc, that makes much easier to apply the MVC patterns when using pygtk and glade, you can see the file organization of our project in the svn repository:

    wader/   cli/   common/   contrib/   gtk/     controllers/     models/     views/   test/   utils/ 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer EDIT: Okay, I've now tracked it down a lot further… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer The '|' is the bitwise OR operator. It basically combines… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Start the project with Ctrl+F5 instead of just F5. The… May 12, 2026 at 1:18 am

Related Questions

Currently i am working on a desktop application which consists mathematical analysiss.I am using
I am working on a small AIR desktop application and I have some configuration
I am working on a legacy project in VC++/Win32/MFC . Recently it became a
I am currently working on a VB.NET desktop application that uses .mdb (Access) database

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.