Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 19/12/2010, à 20:32

kde4 fan

aide creation d'une gui glade comande dans un script

salut
j'essaie de crée un interface graphique avec glade don voici le code :

<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="2.16"/>
  <!-- interface-naming-policy project-wide -->
  <object class="GtkListStore" id="model1">
    <columns>
      <!-- column-name gchararray -->
      <column type="gchararray"/>
      <!-- column-name gchararray1 -->
      <column type="gchararray"/>
    </columns>
  </object>
  <object class="GtkListStore" id="liststore1"/>
  <object class="GtkWindow" id="window1">
    <property name="title" translatable="yes">               Dreamnux</property>
    <property name="resizable">False</property>
    <property name="window_position">center</property>
    <child>
      <object class="GtkVBox" id="vbox1">
        <property name="width_request">345</property>
        <property name="height_request">520</property>
        <property name="visible">True</property>
        <property name="border_width">8</property>
        <property name="spacing">10</property>
        <child>
          <object class="GtkFrame" id="frame1">
            <property name="visible">True</property>
            <property name="label_xalign">0.5</property>
            <property name="shadow_type">in</property>
            <child>
              <placeholder/>
            </child>
          </object>
          <packing>
            <property name="position">0</property>
          </packing>
        </child>
        <child>
          <object class="GtkVBox" id="vbox2">
            <property name="visible">True</property>
            <child>
              <object class="GtkButton" id="button3">
                <property name="label" translatable="yes">VIDEOS</property>
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="is_focus">True</property>
                <property name="receives_default">False</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="button4">
                <property name="label" translatable="yes">XSCREENSAVER</property>
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="receives_default">False</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="button5">
                <property name="label" translatable="yes">STREAMING TV</property>
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="receives_default">False</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="position">2</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">False</property>
            <property name="position">1</property>
          </packing>
        </child>
        <child>
          <object class="GtkScrolledWindow" id="scrolledwindow1">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="hscrollbar_policy">never</property>
            <property name="vscrollbar_policy">never</property>
            <child>
              <object class="GtkTreeView" id="treeview1">
                <property name="visible">True</property>
                <property name="model">model1</property>
                <property name="search_column">0</property>
                <property name="enable_grid_lines">vertical</property>
                <property name="enable_tree_lines">True</property>
                <child>
                  <object class="GtkTreeViewColumn" id="treeviewcolumn1">
                    <property name="sizing">autosize</property>
                    <property name="title">treeviewcolumn1</property>
                    <property name="expand">True</property>
                    <child>
                      <object class="GtkCellRendererText" id="treeviewcolumn1-renderer1"/>
                      <attributes>
                        <attribute name="text">0</attribute>
                      </attributes>
                    </child>
                  </object>
                </child>
                <child>
                  <object class="GtkTreeViewColumn" id="treeviewcolumn2">
                    <property name="sizing">autosize</property>
                    <property name="title">treeviewcolumn2</property>
                    <property name="expand">True</property>
                    <property name="alignment">1</property>
                    <child>
                      <object class="GtkCellRendererText" id="treeviewcolumn2-renderer1"/>
                      <attributes>
                        <attribute name="text">1</attribute>
                      </attributes>
                    </child>
                  </object>
                </child>
              </object>
            </child>
          </object>
          <packing>
            <property name="position">2</property>
          </packing>
        </child>
        <child>
          <object class="GtkTable" id="table1">
            <property name="visible">True</property>
            <property name="n_rows">3</property>
            <property name="n_columns">2</property>
            <child>
              <object class="GtkSpinButton" id="spinbutton1">
                <property name="visible">True</property>
                <property name="xalign">0.5</property>
              </object>
              <packing>
                <property name="left_attach">1</property>
                <property name="right_attach">2</property>
                <property name="top_attach">2</property>
                <property name="bottom_attach">3</property>
                <property name="x_padding">57</property>
              </packing>
            </child>
            <child>
              <object class="GtkCheckButton" id="checkbutton1">
                <property name="label" translatable="yes">Affiche Sur tous les bureaux</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">False</property>
                <property name="active">True</property>
                <property name="draw_indicator">True</property>
              </object>
            </child>
            <child>
              <object class="GtkCheckButton" id="checkbutton2">
                <property name="label" translatable="yes">Désactive Le Son Des Vidéos</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">False</property>
                <property name="active">True</property>
                <property name="draw_indicator">True</property>
              </object>
              <packing>
                <property name="left_attach">1</property>
                <property name="right_attach">2</property>
              </packing>
            </child>
            <child>
              <object class="GtkCheckButton" id="checkbutton3">
                <property name="label" translatable="yes">Désactivé Au Démarrage</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">False</property>
                <property name="active">True</property>
                <property name="draw_indicator">True</property>
              </object>
              <packing>
                <property name="top_attach">1</property>
                <property name="bottom_attach">2</property>
              </packing>
            </child>
            <child>
              <object class="GtkCheckButton" id="checkbutton4">
                <property name="label" translatable="yes">Désactive Le Fond D'Écran</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">False</property>
                <property name="active">True</property>
                <property name="draw_indicator">True</property>
              </object>
              <packing>
                <property name="left_attach">1</property>
                <property name="right_attach">2</property>
                <property name="top_attach">1</property>
                <property name="bottom_attach">2</property>
              </packing>
            </child>
            <child>
              <object class="GtkCheckButton" id="checkbutton5">
                <property name="label" translatable="yes">Ajustez Le Temps Au Boot</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">False</property>
                <property name="draw_indicator">True</property>
              </object>
              <packing>
                <property name="top_attach">2</property>
                <property name="bottom_attach">3</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="position">3</property>
          </packing>
        </child>
        <child>
          <object class="GtkHBox" id="hbox1">
            <property name="visible">True</property>
            <child>
              <object class="GtkButton" id="button2">
                <property name="label" translatable="yes">Annuler</property>
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="receives_default">False</property>
              </object>
              <packing>
                <property name="fill">False</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkVBox" id="vbox3">
                <property name="visible">True</property>
                <child>
                  <object class="GtkLabel" id="label12">
                    <property name="visible">True</property>
                    <property name="label" translatable="yes">     (+)      Ajustez La Transparence      (-)</property>
                  </object>
                  <packing>
                    <property name="position">0</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkHScale" id="hscale1">
                    <property name="height_request">12</property>
                    <property name="visible">True</property>
                    <property name="digits">0</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">False</property>
                    <property name="position">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkLabel" id="label13">
                    <property name="visible">True</property>
                    <property name="xalign">0</property>
                    <property name="label" translatable="yes">Plus Visible a gauche Moins Visible a droite</property>
                  </object>
                  <packing>
                    <property name="position">2</property>
                  </packing>
                </child>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="button1">
                <property name="label" translatable="yes">Valider</property>
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="receives_default">False</property>
              </object>
              <packing>
                <property name="fill">False</property>
                <property name="position">2</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">False</property>
            <property name="padding">6</property>
            <property name="position">4</property>
          </packing>
        </child>
      </object>
    </child>
  </object>
</interface>

capture

1: comment faire en sorte quand le bouton (videos) est cliquer q il puisse afficher dans le cadre du dessous la liste des fichier vidéos sur 2 colonnes trier par ordre alphabétique (chemin de répertoire défini)

2: idem pour xscrensaver

3: idem pour les chaines de tv en streaming (il faut une commande de téléchargement puis de trie des chaine )

4: le cadre du haut sert a la prévisualisation des fichiers sélectionner comment y parvenir (pas de widget multimédia dans glade ?)

5: les case a cocher doive écrire dans le scripte la ligne de commande pour lancer les programmes (case 1=s ou case 2=vidéos ect..)

6: le bouton anules efface les commandes dans le scripte et le valider bouton confirme la commande en entier puis l'exécute

le principe serait d'écrire au fur et a mesure des choix la ligne de commande dans un scripte puis l'exécuter

merci

Dernière modification par kde4 fan (Le 19/12/2010, à 21:26)


-------------------------------------------------------------------BONJOUR ET MERCI-----------------------------------------------------------
kubuntu 64 12.04 et Linux-Mint Maya 64 (MATE)
Bureau Animer Dreamnux : http://forum.ubuntu-fr.org/viewtopic.php?id=325865
Bureau Animer kreamnux : http://forum.kubuntu-fr.org/viewtopic.php?pid=8916691

Hors ligne

#2 Le 20/12/2010, à 01:01

AnsuzPeorth

Re : aide creation d'une gui glade comande dans un script

Bjr,
Il faudrait déjà savoir en quel language tu code !
Ensuite se référer à la doc correspondante.


Interface graphique pour bash, python ou autre: glade2script
Support Tchat: http://chat.jabberfr.org/muckl_int/inde … ade2script  (Hors ligne)

Hors ligne

#3 Le 20/12/2010, à 02:43

kde4 fan

Re : aide creation d'une gui glade comande dans un script

Il faudrait déjà savoir en quel language tu code !

oui a définir le plus simple et le mieux adapter pour un débutant (du bash serait plus simple pour moi)

Ensuite se référer à la doc correspondante.

souvent les doc pousser sont en anglais


-------------------------------------------------------------------BONJOUR ET MERCI-----------------------------------------------------------
kubuntu 64 12.04 et Linux-Mint Maya 64 (MATE)
Bureau Animer Dreamnux : http://forum.ubuntu-fr.org/viewtopic.php?id=325865
Bureau Animer kreamnux : http://forum.kubuntu-fr.org/viewtopic.php?pid=8916691

Hors ligne

#4 Le 20/12/2010, à 05:05

AnsuzPeorth

Re : aide creation d'une gui glade comande dans un script

oui a définir le plus simple et le mieux adapter pour un débutant (du bash serait plus simple pour moi)

Ben ... tout dépends comment tu vois ton avenir de programmeur smile

Si tu comptes par la suite de lancer dans de plus gros projet (en terme de traitement), ou développer ce projet "à fond", tu devrais te lancer dans le python.

Par contre, si tu compte juste faire des petit soft pas trop complexe qui utilisent en grande partie des commandes systèmes, ou que tu as déjà de bonne connaissances en bash et pas trop envie de te lancer dans un nouvel apprentissage, reste avec et utilise glade2script pour "brancher" ton script sur l'interface, ca demande un petit apprentissage également, mais moins important que python et pygtk.

Tu peux également utiliser glade2script avec un script python, ca permettrait dans un premier temps d'apprendre le python sans se soucier de la gestion de l'interface (qui est un peu délicat et surtout une grosse doc à ingurgiter). Une fois python maitrisé, se lancer dans pygtk.

A savoir que glade2script ne remplacera jamais pygtk, certaines fonctions de GTK ne sont pas accessibles, mais bon, on peut déjà faire pas mal de chose.


Interface graphique pour bash, python ou autre: glade2script
Support Tchat: http://chat.jabberfr.org/muckl_int/inde … ade2script  (Hors ligne)

Hors ligne

#5 Le 20/12/2010, à 12:43

Rolinh

Re : aide creation d'une gui glade comande dans un script

AnsuzPeorth a écrit :

Si tu comptes par la suite de lancer dans de plus gros projet (en terme de traitement), ou développer ce projet "à fond", tu devrais te lancer dans le python.

C n'est pas mal non plus avec GTK wink

Hors ligne

#6 Le 20/12/2010, à 12:49

patate_chaude

Re : aide creation d'une gui glade comande dans un script

qt est pas mal non plus, surtout si tu es sous kde.

Hors ligne

#7 Le 20/12/2010, à 13:11

Rolinh

Re : aide creation d'une gui glade comande dans un script

Oui mais sa demande concernait Glade et par conséquent GTK+ wink

Hors ligne

#8 Le 20/12/2010, à 14:06

kde4 fan

Re : aide creation d'une gui glade comande dans un script

AnsuzPeorth
merci pour tes conseilles aviser
glade2script permet il de réaliser mon projet de A a Z ?

python a l'aire très puissant et très compliquer pour moi

j'ai installer edi ajunta ce soft me permet t il de réaliser mon projet de A a Z

merci (cette gui servira pour gnome dans 1 premier temps a voire si utile sous kde)


-------------------------------------------------------------------BONJOUR ET MERCI-----------------------------------------------------------
kubuntu 64 12.04 et Linux-Mint Maya 64 (MATE)
Bureau Animer Dreamnux : http://forum.ubuntu-fr.org/viewtopic.php?id=325865
Bureau Animer kreamnux : http://forum.kubuntu-fr.org/viewtopic.php?pid=8916691

Hors ligne

#9 Le 20/12/2010, à 16:08

AnsuzPeorth

Re : aide creation d'une gui glade comande dans un script

glade2script permet il de réaliser mon projet de A a Z ?

A part le point 4, qui n'est pas très clair, oui.
Si par prévisualiser un fichier, tu entends pouvoir le lire dans ton interface, il te faudra coder ca en pygtk, glade2script n'a rien de prevu pour embarquer un lecteur dans l'interface.
Il n'y a pas de widget prédéfini, il faut embarquer mplayer par exemple, avec une histoire de socket & co, un peu complexe à mettre en oeuvre. J'avais pensé ajouter cette fonctionnalité, mais pas le temps en ce moment, et je me demande si vraiment utile.
glade2script a surtout été créer pour remplacer gtkdialog, qui n'est plus soutenue et était rempli de bug et limitation.

python a l'aire très puissant et très compliquer pour moi

Franchement, python n'est vraiment pas compliqué, a part la spécification de la POO qui peut paraitre un peu étrange au début, sinon ce language est vraiment pas mal, je pense que ca vaut la peine de s'y pencher sérieusement (et je me répète, mais il n'est vraiment pas compliqué, sur certain point, bien plus simple que bash, sur certain point !)

j'ai installer edi ajunta ce soft me permet t il de réaliser mon projet de A a Z

Je peux pas te dire, j'utilse un éditeur de texte pour coder, j'aime pas tous ces soft qui "mache" le travail, c'est le meilleur moyen de ne rien retenir.


Interface graphique pour bash, python ou autre: glade2script
Support Tchat: http://chat.jabberfr.org/muckl_int/inde … ade2script  (Hors ligne)

Hors ligne

#10 Le 20/12/2010, à 20:29

kde4 fan

Re : aide creation d'une gui glade comande dans un script

pygtk serait le mieux pour le projet car utilisation de mplayer pour la prévisualisation
merci


-------------------------------------------------------------------BONJOUR ET MERCI-----------------------------------------------------------
kubuntu 64 12.04 et Linux-Mint Maya 64 (MATE)
Bureau Animer Dreamnux : http://forum.ubuntu-fr.org/viewtopic.php?id=325865
Bureau Animer kreamnux : http://forum.kubuntu-fr.org/viewtopic.php?pid=8916691

Hors ligne

#11 Le 20/12/2010, à 20:41

AnsuzPeorth

Re : aide creation d'une gui glade comande dans un script

kde4 fan a écrit :

pygtk serait le mieux pour le projet car utilisation de mplayer pour la prévisualisation
merci

Oui, mais c'est un gros apprentissage, python et surtout pygtk qui demandera plus de temps (surtout pour ce que tu veux faire) !


Interface graphique pour bash, python ou autre: glade2script
Support Tchat: http://chat.jabberfr.org/muckl_int/inde … ade2script  (Hors ligne)

Hors ligne