Léa-Linux & amis :   LinuxFR   GCU-Squad   GNU
gui sous linux
Envoyé par: fgh39

je recherche un logiciel simple pour créer un interface graphique

J'ai regardé avec Glade, Python, qt désigner et tcl / tk
Le plus attrayant c'est qt desigenr fourni, mais je ne comprend pas comment relier l'action d'un bouton par exemple à un commande du shell comme copier des fichiers 'cp'
tcl / tk à l'air pas mal mais je cherche aussi le mème type de commande.

Y as il une aide si possible en bon Français pour ces logiciels de développement ?

Merci d'avance

Poste le Wednesday 7 January 2004 14:44:56
Répondre     Citer    
Re: gui sous linux
Envoyé par: herbert

Xdialog aussi ça peut aider...
selon tes besoins...

Poste le Thursday 8 January 2004 13:29:11
Répondre     Citer    
Re: gui sous linux
Envoyé par: fgh39

en fait je sais pas vraiment progrmmer en language évolué
L'asm 68hc11 je connais par contre
Je m'intérresse à créer une interface gui pour faire une aide d'installation linux sympa, modifier l'interieur d'un fichier ou bien faire une copie de fichier vers un réprtoire, etc, etc
G regardé QT désigner ça a l'air pas mal aussi g vu qu'on peut générer du code en C++
Mai sj'y connais pas grand chose au C++
Je connais un peu le C > (printf, scanf, etc, etc ...)
G un peu compris le script bash.
Par contre là ou je plante c comment relier l'action d'un bouton à une commande du shell ?
Quelqu'un pourrais il me donner un commande concrete, un exemple ?
Ou sinon trouver un tutoriel en Français cal l'english c pas vraiment mon fort.

pitiiééé !

Poste le Thursday 8 January 2004 18:51:30
Répondre     Citer    
Re: gui sous linux
Envoyé par: sanglier

#!/bin/sh
if [ $# -lt 1 ]
then
exit 0
fi
LONG=`wc -l $1|awk '{print $1}'`
if [ $LONG -gt 40 ]
then
LONG=40
fi
Xdialog --title "$0 fichier : $1" --logbox $1 `expr $LONG + 6` 100



donne une fenetre de type texte avec dedans une frame ou tu peux lire et faire defiler un texte....

fais un whereis Xdialog pour voir si tu l'as et si oui fais le test ca vaut mieux qu'un long discourt...


-------------------------
autre exemple en perl associe a tk :
-------------------------

#!/usr/bin/perl -w

require 5.002;
use English;
use Tk;
use Tk:grinning smileyialogBox;
sub convert ;

my $MW = MainWindow->new;


$MW->title("Temperature Converter");
$MW->Label(-text => "Version 0.1 - Written by Alan Ford\n<alan\@whirlnet.demon.co.uk>")->pack(-side => 'bottom');

my $ans;

my $exit = $MW->Button(-text => 'Exit',
-command => sub
{
exit;
});
$exit->pack(-side => 'bottom', -expand => '1', -fill => 'both');

my $convert = $MW->Button(-text => 'Convert',
-command => sub
{
convert;
});
$convert->pack(-side => 'bottom', -expand => '1', -fill => 'both');

my $answer_frame = $MW->Frame()->pack(-expand => '1', -fill => 'both', -side
=> 'bottom');

$answer_frame->Label(-text => "Converted value:")->pack(-side => 'left');
my $answer_value = $answer_frame->Entry(-width => '15', -relief => 'sunken')->pack(-side => 'right');

my $value_frame = $MW->Frame()->pack(-expand => '1', -fill => 'both', -side =>
'bottom');

$value_frame->Label(-text => "Enter value to convert:")->pack(-side => 'left');
my $convert_value = $value_frame->Entry(-width => '10', -relief => 'sunken')->pack(-side => 'right');

my $from_frame = $MW->Frame(-relief => 'raised', -width => '100', -height => '200');
$from_frame->pack(-side => 'left', -expand => '1', -fill => 'both');

my $to_frame = $MW->Frame(-relief => 'raised', -width => '100', -height => '200');
$to_frame->pack(-side => 'right', -expand => '1', -fill => 'both');

$from_frame->Label(-text => "Convert From")->pack();
my $from_celsius = $from_frame->Radiobutton(-variable => \$from,
-value => '1',
-text => 'Celsius')->pack(-side => 'top', -anchor => 'w');

my $from_fahrenheit = $from_frame->Radiobutton(-variable => \$from,
-value => '2',
-text => 'Fahrenheit')->pack(-side => 'top', -anchor => 'w');

my $from_kelvin = $from_frame->Radiobutton(-variable => \$from,
-value => '3',
-text => 'Kelvin')->pack(-side => 'top', -anchor => 'w');

my $from_rankine = $from_frame->Radiobutton(-variable => \$from,
-value => '4',
-text => 'Rankine')->pack(-side => 'top', -anchor => 'w');

my $from_reaumur = $from_frame->Radiobutton(-variable => \$from,
-value => '5',
-text => 'Reaumur')->pack(-side => 'top', -anchor => 'w');

$to_frame->Label(-text => "Convert To")->pack();
my $to_celsius = $to_frame->Radiobutton(-variable => \$to,
-value => '1',
-text => 'Celsius')->pack(-side => 'top', -anchor => 'w');

my $to_fahrenheit = $to_frame->Radiobutton(-variable => \$to,
-value => '2',
-text => 'Fahrenheit')->pack(-side => 'top', -anchor => 'w');

my $to_kelvin = $to_frame->Radiobutton(-variable => \$to,
-value => '3',
-text => 'Kelvin')->pack(-side => 'top', -anchor => 'w');

my $to_rankine = $to_frame->Radiobutton(-variable => \$to,
-value => '4',
-text => 'Rankine')->pack(-side => 'top', -anchor => 'w');

my $to_reaumur = $to_frame->Radiobutton(-variable => \$to,
-value => '5',
-text => 'Reaumur')->pack(-side => 'top', -anchor => 'w');


$from_celsius->select;
$to_fahrenheit->select;

MainLoop;

sub convert {
my $question = $convert_value->get;
if ($from == '1') {
if ($to == '1') {
$ans = $question;
}
if ($to == '2') { $ans = ($question * 1.8) + 32;
}
if ($to == '3') {
$ans = $question + 273.16;
}
if ($to == '4') {
$ans = ($question + 273.16) * 1.8;
}
if ($to == '5') {
$ans = $question / 1.25;
}
}
if ($from == '2') {
if ($to == '1') {
$ans = ($question - 32) / 1.8;
}
if ($to == '2') {
$ans = $question;
}
if ($to == '3') {
$ans = ($question + 459.67) / 1.8;
}
if ($to == '4') {
$ans = $question + 459.67;
}
if ($to == '5') {
$ans = ($question - 273.16) / 1.25;
}
}
if ($from == '3') {
if ($to == '1') {
$ans = $question - 273.16;
}
if ($to == '2') {
$ans = ($question * 1.8) - 459.67;
}
if ($to == '3') {
$ans = $question;
}
if ($to == '4') {
$ans = $question * 1.8;
}
if ($to == '5') {
$ans = ($question - 273.16) / 1.25;
}
}
if ($from == '4') {
if ($to == '1') {
$ans = ($question / 1.8) - 273.16;
}
if ($to == '2') {
$ans = $question - 459.67;
}
if ($to == '3') {
$ans = $question / 1.8;
}
if ($to == '4') {
$ans = $question;
}
if ($to == '5') {
$ans = (($question / 1.8) - 273.16) / 1.25;
}
}
if ($from == '5') {
my $kelvin = ($question * 1.25) + 273.16;
if ($to == '1') {
$ans = $kelvin - 273.16;
}
if ($to == '2') {
$ans = ($kelvin * 1.8) - 459.67;
}
if ($to == '3') {
$ans = $kelvin;
}
if ($to == '4') {
$ans = $kelvin * 1.8;
}
if ($to == '5') {
$ans = ($kelvin - 273.16) / 1.25;
}
}

$answer_value->delete('0', 'end');
$answer_value->insert('0', $ans);

my $dialog = $MW->DialogBox( -title => "Temperature Converter",
-buttons => [ "OK" ],
);
@scales = ("degrees Celsius", "degrees Fahrenheit", "Kelvin", "degrees Rankine", "degrees Reaumur");
$dialog->add("Label", -text => "$question $scales[$from-1] is $ans $scales[$to-1]")->pack;
$dialog->Show;
}



un langages de scripting (perl) et des entrees TK pour l'interfaces graphique


faut jouer avec le modifier ajouter des fonctions etc....

c'est le meilleur moyen d'apprendre....


Moi aussi je commence juste a programmer en script sous X....
donc je peux pas trop entrer dans le details

Poste le Thursday 8 January 2004 20:32:44
Répondre     Citer    
Re: gui sous linux
Envoyé par: Neuromancien

>> Je m'intérresse à créer une interface gui pour faire une aide d'installation linux sympa, modifier l'interieur d'un fichier ou bien faire une copie de fichier vers un réprtoire, etc, etc
Je suis en train d'essayer de créer qch de similaire, mais sous Python, c plus simple que C++.



The software said "Requires Windows98, Win2000, or better."
So I installed Linux.

Poste le Monday 12 January 2004 18:07:54
Répondre     Citer    

Veuillez vous authentifier auparavant pour commenter.

 

Ce forum !
gui sous linux
Pour poser vos questions sur les scripts shell, le Perl, le C, etc... Attention : nous ne sommes pas des spécialistes du dev, ce forum est juste pour de petites aides ponctuelles concernant le développement et les outils de développement.

Sauf mention contraire, les documentations publiées sont sous licence Creative-Commons