test-GuiTextView.cxx File Reference

#include <Midad/Gui/GuiButton.h>
#include <Midad/Gui/GuiTextView.h>
#include <Midad/Gui/GuiMainWindow.h>
#include <Midad/Gui/GuiBox.h>
#include <Midad/Gui/GuiTextEntry.h>
#include "TROOT.h"
#include "TApplication.h"
#include <sigc++/sigc++.h>
#include <sigc++/retype_return.h>
#include <string>
#include <vector>

Go to the source code of this file.

Functions

void spawn_text_window (void)
void update_text (GuiTextEntry *gte)
int main (int argc, char *argv[])

Variables

vector< Ptr< GuiTextView > > gui_text_views

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 45 of file test-GuiTextView.cxx.

References GuiTextEntry::activated, GuiCompositeFrameBase::Add(), GuiButtonBase::clicked, GuiMainWindow::ConnectClose(), GuiBase::SetLayoutHints(), GuiMainWindow::SetMinSize(), GuiMainWindow::ShowAll(), spawn_text_window(), and update_text().

00046 {
00047     TApplication theApp("App", &argc, argv);
00048 
00049     GuiMainWindow mw(300,300);
00050 
00051     GuiBox box(mw,kVerticalFrame);
00052     mw.Add(box);
00053 
00054     GuiTextView gtv(box,300,300);
00055     box.Add(gtv);
00056     gui_text_views.push_back(&gtv);
00057 
00058 
00059     GuiTextEntry gte(box);
00060     box.Add(gte);
00061 
00062     GuiTextButton but(box,"Spawn GuiTextWindow");
00063     but.SetLayoutHints(kLHintsExpandX);
00064     box.Add(but);
00065 
00066 
00067     but.clicked.connect(slot(spawn_text_window));
00068     gte.activated.connect(bind(slot(update_text),&gte));
00069     
00070 
00071 
00072     mw.ShowAll();
00073     mw.SetMinSize();
00074     mw.ConnectClose();
00075 
00076     theApp.Run();
00077     return 0;
00078 } // end of main()

void spawn_text_window ( void   ) 

Definition at line 20 of file test-GuiTextView.cxx.

References GuiCompositeFrameBase::Add(), GuiButtonBase::clicked, GuiMainWindow::ConnectClose(), and GuiMainWindow::ShowAll().

Referenced by main().

00021 {
00022     GuiMainWindow* gmw = new GuiMainWindow(300,300);
00023     GuiTextView* gtv = manage(new GuiTextView(*gmw,300,300));
00024     gmw->Add(*gtv);
00025 
00026     gui_text_views.push_back(gtv);
00027 
00028     GuiTextButton* but = manage(new GuiTextButton(*gmw,"close"));
00029     gmw->Add(*but);
00030     but->clicked.connect(slot(*gmw,&GuiMainWindow::SendCloseMessage));
00031 
00032     gmw->ShowAll();
00033     gmw->ConnectClose(false);
00034 }

void update_text ( GuiTextEntry gte  ) 

Definition at line 37 of file test-GuiTextView.cxx.

Referenced by main().

00038 {
00039     const char* text = gte->GetText();
00040     for (unsigned int ind = 0; ind < gui_text_views.size(); ++ind) {
00041         gui_text_views[ind]->AddLine(text);
00042     }
00043 }


Variable Documentation

Definition at line 18 of file test-GuiTextView.cxx.


Generated on 8 Jul 2019 for loon by  doxygen 1.6.1