2 /* Circ.Frontend.GtkSharp : GTK# frontend for Circ
3 * Copyright (C) 2007 LAVAL Jérémie
5 * This file is licensed under the terms of the LGPL.
7 * For the complete licence see the file COPYING.
13 using Circ
.Controller
;
15 namespace Circ
.Frontend
.GtkSharp
17 [Mono
.Addins
.Extension("/Circ/Frontends", Id
="Gtk")]
18 public class GtkFrontend
: IFrontend
20 static IFactory facto
= new Factory();
21 MainWindow mainWindow
;
24 public void StartPresentation(IMainControl ctrl
)
26 Mono
.Unix
.Catalog
.Init("circ", "/usr/share/locale");
27 Gtk
.Application
.Init();
28 mainWindow
= new MainWindow(ctrl
);
30 Gtk
.Application
.Run();
33 public void StopPresentation()
35 Gtk
.Application
.Invoke(delegate(object sender
, EventArgs e
) {
36 Gtk
.Application
.Quit();
40 public void AddDiscussion(IDiscussionPanel panel
)
42 Gtk
.Application
.Invoke( delegate (object s
, EventArgs e
) {
43 ChannelPanel temp
= (ChannelPanel
)panel
;
44 temp
.ServerPanel
.AddChildDiscussion(temp
);
45 temp
.ServerPanel
.CurrentPage
= temp
.ServerPanel
.NPages
- 1;
49 public void AddServer(IServerPanel panel
)
51 Gtk
.Application
.Invoke( delegate {
52 ServerPanel temp
= (ServerPanel
)panel
;
53 Label lbl
= new Label(temp
.ServerName
);
54 mainWindow
.ServerContainer
.AppendPage(temp
, lbl
);
60 public IFactory ToolkitFactory
{
72 public bool IsInitialized
{