Lumiera  0.pre.03
»edit your freedom«
error-log-display.hpp File Reference

Go to the source code of this file.

Description

Widget to display error messages to be accessible in non-modal way.

Notifications are shown in a simple text window with scrollbars; new entries can be added with a severity level, causing the widget to scroll down to the last line of the content buffer.

Lifecycle considerations

The ErrorLogDisplay is typically managed as child of a container widget. However, the ctrl::NotificationHub as controller does a lookup and attaches to an ErrorLogDisplay found within the InfoBoxPanel, using it as holder for information and error messages pushed into the GUI. For that reason, it is important really to destroy the ErrorLogDisplay, when it is taken out of service. Since ErrorLogDisplay inherits from sigc::trackable, it is automatically detached from the WLink implementing this cross-attachment, but only when actually the dtor is called.

Note
this is a special convention; usually it is sufficient just to hide() a GTK widget, because it is then left alone by the event handling and automatically cleaned up at shutdown. Moreover, if you remove() a widget from a container, the container no longer manages the widget, so you are responsible to take ownership in such situations. And, as said, in case of the ErrorLogDisplay, you should delete it.
Remarks
the standard use case is to have the ErrorLogDisplay sitting within the InfoBoxPanel. If the latter is destroyed, it destroys its children and all works as expected without much ado.
Todo:

WIP-WIP-WIP as of 9/2017 this is a first draft of a widget to be used as receiver by the GuiNotificationService.

WIP-WIP and in 9/2018 this draft gradually shifts towards a prototype how to deal with custom configured widget behaviour, and how to integrate with our GUI framework (#1099)

Definition in file error-log-display.hpp.

#include "stage/gtk-base.hpp"
#include "stage/style-scheme.hpp"
#include "stage/model/flash-deco.hpp"
#include "stage/model/expander-revealer.hpp"
#include "include/gui-notification-facade.h"
#include "lib/format-string.hpp"
#include "lib/symbol.hpp"
#include "lib/util.hpp"
#include <utility>
#include <vector>

Classes

class  ErrorLogDisplay
 Widget to display log and error messages. More...
 

Typedefs

using Tag = Glib::RefPtr< Gtk::TextBuffer::Tag >
 

Functions

void populateStandardTextTags (Glib::RefPtr< TextBuffer::TagTable > tagTable)
 

Namespaces

 stage
 Lumiera GTK UI implementation root.
 
 stage::widget
 Lumiera custom widgets.