premier jet d'interface graphique

This commit is contained in:
Adrien Bourmault 2021-11-30 14:35:48 +00:00
parent e0bb902ab8
commit fd24472805
5 changed files with 226 additions and 21 deletions

View File

@ -23,31 +23,14 @@
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from lxml import etree
modelPath = "../models/dimers random walk.xml"
schemPath = "../schemas/models_0.2.xmls"
tree = etree.parse(modelPath)
glade_path = "../ui/GLArea.glade"
## Main window
builder = Gtk.Builder()
builder.add_from_file(glade_path)
class MyWindow(Gtk.Window):
def __init__(self):
super().__init__(title="Hello World")
self.button = Gtk.Button(label="Click Here")
self.button.connect("clicked", self.on_button_clicked)
self.add(self.button)
def on_button_clicked(self, widget):
print("Hello World")
win = MyWindow()
win.connect("destroy", Gtk.main_quit)
win = builder.get_object("Appwindow")
win.show_all()
Gtk.main()

7
src/shaders/shader.frag Normal file
View File

@ -0,0 +1,7 @@
uniform vec2 resolution;
void main()
{
gl_FragColor = vec4(gl_FragCoord.x / resolution.x,1,1,1);
}

4
src/shaders/shader.vert Normal file
View File

@ -0,0 +1,4 @@
void main()
{
gl_Position = ftransform();
}

211
ui/GLArea.glade Normal file
View File

@ -0,0 +1,211 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- This file is temporary and meant to test graphic features -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="window-position">center</property>
<property name="default-width">800</property>
<property name="default-height">600</property>
<property name="gravity">static</property>
<child>
<object class="GtkPaned">
<property name="name">tout ce qui est sous la 'header bar'</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkPaned">
<property name="name">Image 1D + contrôles</property>
<property name="height-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixbuf">espace 1D projet.jpg</property>
</object>
</child>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">True</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="height-request">18</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">center</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Zoom</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Filtres</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Apparences</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">True</property>
</packing>
</child>
</object>
<packing>
<property name="resize">False</property>
<property name="shrink">True</property>
</packing>
</child>
<child>
<object class="GtkPaned">
<property name="name">tout ce qui est sous l'image 1D et ses contrôles</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">transitions </property>
<property name="width-request">700</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="resize">False</property>
<property name="shrink">True</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">objets</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">True</property>
</packing>
</child>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">True</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="can-default">True</property>
<property name="tooltip-text" translatable="yes">Salut ! Je suis la nouvelle barre de commandes.</property>
<property name="title" translatable="yes">Gem-graph</property>
<property name="has-subtitle">False</property>
<property name="spacing">2</property>
<property name="show-close-button">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">2</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">utilisateur (préférences)</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="mon_bouton">
<property name="label" translatable="yes">modèle (load / save)</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="toggled" handler="tilt" object="__glade_Hi" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">états / transitions</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">monitoring et contrôles / éditions</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

BIN
ui/espace 1D projet.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB