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 3871022
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:47:01+00:00 2026-05-19T21:47:01+00:00

I started a GTKMM application about 6 months ago and it’s reached the point

  • 0

I started a GTKMM application about 6 months ago and it’s reached the point where everything works and I actually use it daily. It’s essentially a database application that reads in data files from another application, generates graphs and lets you easily sort and view the data. I like it.

HOWEVER, I believe my code is a mess and when I went to implement another feature today I realized that I probably made a wrong turn somewhere.

My main window GUI is defined in a glade file and ALL of the GUI (other than my plot widget which is a custom widget based on a Gtk::DrawingArea) is in a single file. It is FULL of pointers to widgets and treestores that all get setup in the constructor and deleted in the destructor.

The entire GUI is a main window split into different panes so it made sense to have everything in 1 file. Also, different panes need to “communicate” with other panes.

How should I better organize my code so that it is maintainable? Do I make a new class that is essentially a collection of widgets and then place that “super widget” in my main window (say each pane is a super widget)?

GTKMM tutorials are generally very minimalistic so I couldn’t get much insight there.

  • 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-05-19T21:47:02+00:00Added an answer on May 19, 2026 at 9:47 pm

    I currently work on a large GTKMM application. The general rule that is followed throughout the codebase is that each Frame (containing a collection of widgets) is its own class in its own cpp file. These classes are then instantiated in the main function as singleton classes each exposing a getFrame method.

    // Single instance of this class.
    SomeGUIComponent* SomeGUIComponent::m_instance = NULL;
    
    SomeGUIComponent& SomeGUIComponent::getInstance()
    {
      if (m_instance == NULL)
      {
        m_instance = new SomeGUIComponent();
      }
      return *m_instance;
    }
    
    Gtk::Frame& SomeGUIComponent::getFrame()
    {
      return m_myMasterFrame;
    }
    

    So this can be added to the larger application with:

    SomeGUIComponent::getInstance().getFrame()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Started to learn programming 2 months ago, in one of my little projects i
I started an application in Google App Engine right when it came out, to
I started a Rails project recently and decided to use RESTful controllers. I created
I started out with Django some days ago and I have now made a
I started studying Haskell one week ago and have one strange problem. I created
I'm working on a plugin for a smaller application using gtkmm. The plugin I'm
I'm trying to get started with gtkmm, and I'm using a mac. So I
I started with a new ASP.NET MVC 2 Web Application template and created a
Started using PDO prepared statements not too long ago, and, as i understand, it
Started building an application here. client and server style architecture sending active resources across

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.