IBM developerWorks: GNOMEnclature: Handling multiple documents - Using the GnomeMDI framework | Linux Today

IBM developerWorks: GNOMEnclature: Handling multiple documents – Using the GnomeMDI framework

Written By
Web Webster
Web Webster
Sep 9, 2000

In this installment, George Lebl turns away from widgets to
look at GnomeMDI, the Multiple Documents Interface from gnome-libs.
GnomeMDI makes it easier to handle a variety of different documents
at the same time in one program.

“Many end-user applications are document-centric (that is, they
are tools for manipulating documents of one type or another). End
users of these applications generally consider them merely a
convenient way to modify a document. (Applications that are not
document-centric focus on things like the program itself; games are
a good example of this). From the end user’s perspective, it’s
easier to think of document-centric applications in terms of
opening new documents, rather than in terms of running a program.
When you look at it this way, the program just happens to start up
when you open a document. Taking this perspective one step further,
there should be nothing too strange about editing multiple
documents at the same time. However, as most programmers know,
running multiple instances of one program does not work all that
smoothly. The two primary problems are that multiple instances do
not cooperate nicely and they take up way too much memory. A
Multiple Document Interface such as the GnomeMDI simplifies these
problems by handling the user interface. So, let’s take a closer
look at how the GnomeMDI does this.”

“GnomeMDI is actually not a widget but a simple object, because
it derives directly from GtkObject, the main object of your
application. Most likely, you will create only one of these and
store it as a global variable. The document we will create here is
the GnomeMDIChild, which is actually a second type of simple object
altogether. (If your application were opening files, for example,
there would be exactly one GnomeMDIChild for each file.) Each
GnomeMDIChild can also have one or more views. Each view is a
GtkWidget, which knows how to display the data that GnomeMDIChild
stores. Now this is where the tricky part comes in. In order to use
GnomeMDI, you must be able to store all data relevant to a file
without having any view. You must also be able to update several
views simultaneously. You should not therefore store any data in
the view widget itself. You should always be able to generate
another view, purely from the data stored in the GnomeMDIChild
object. This is usually called the Model/View/Controller
design.”


Complete Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.