-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.rb
63 lines (45 loc) · 1.16 KB
/
Main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
begin
require 'rubygems'
rescue LoadError
end
require 'gtk3'
require './Interface/fConnexion.rb'
require './Classes/Header.rb'
require './Classes/App.rb'
#Gtk.init
def onDestroy
puts "Fin de l'application"
Gtk.main_quit
end
def configureMonApp(uneApp)
##
# Taille de la fenêtre
uneApp.window.set_default_size(uneApp.width,uneApp.height)
##
# On ne peut pas redimensionner
uneApp.window.set_resizable(false)
##
#L'application est toujours centrée
uneApp.window.set_window_position(Gtk::WindowPosition::CENTER_ALWAYS)
end
if ARGV.size.eql?(0) then
monApp = App.new(Gtk::Window.new, 1205,740)
configureMonApp(monApp)
# Titre de la fenêtre
header = Header.new(monApp.window)
##
# Box principale
page = FConnexion.new(monApp, header, nil, nil)
page.ajouteMoi
######FIN########
##
# Ajout du header a la fenetre
monApp.window.titlebar = header
monApp.window.show_all
##
#Quand la fenêtre est détruite il faut quitter
monApp.window.signal_connect('destroy') {onDestroy}
Gtk.main
else
puts "Usage Error O argument pour le Tents&Trees"
end