Chinese (People's Republic of China)  English  Français


Supinfo-Projects.com
Tous les projets des élèves ingénieurs de Supinfo



Projets
  Dernier Projet
  Les plus populaires
  Tous les Projets

134 Visiteurs
3168 Projets


My Supinfo-Projects

   Connectez-vous
   Créez un Compte


Synopsis

   174 Visites
   Note INTERNET : 13.3
    (3 Votants)
   1199 Commentaires

   Lire l'article

Evaluez cet article

20
18
16
14
12
10
8
6
4
2
0


Commentez cet article

Auteur :

Email :

Votre commentaire :



 
2005 - Note de Synthèse Stage
Introduction to Gtk2-Perl
[30 mn de lecture - paru le 10/7/2004 3:02:44 PM - Public : Confirmé]

Auteur

artistPrzemyslaw BRODACKI
Elève-Ingénieur Supinfo Paris
Promotion SUPINFO 2004

   Lui écrire
   Tous les projets de cet auteur
   Le mini-CV de cet auteur

3. Advanced Elements

    3.1. Text fields

The text fields seem simple. But they can react to multiple signals.

$entree = Gtk::Entry->new();

The object above is a text field where we can type only one line. The content can be accessed with:

$entree->set_text( $text );  
$entree->append_text( $text );  
$entree->prepend_text( $text );

We can set the text invisible::

$entree->set_visibility($visible ); #valeur booléenne.

We can create large text fields with:

$editable->select_region( $start, $end );

And modify the content with :

$editable->insert_text( $new_text, $position );
$editable->delete_text( $start, $pos );
$editable->get_chars( $start, $end );
$editable->cut_clipboard();
$editable->copy_clipboard();
$editable->paste_clipboard();
$editable->delete_selection();

These methods are quite simple to understand, there is no need to explain them.

Any action on the text field generates signals which may be 'changed', 'insert-text', 'delete-text'.... The list of generated signals is too large to describe.

    3.2. Dialog boxes

Dialog boxes alow interaction between the user and the software.:

$dialog = Gtk2::Dialog->new($titre,$parent,$flags...);

dialog boxes contain in general text (a label) and buttons. To achieve that, these elements are stacked in a VBOX.

The actions on dialog boxes may be:

- 'none'  
- 'reject'  
- 'accept'  
- 'delete-event'  
- 'ok'  
- 'cancel'  
- 'close'  
- 'yes'  
- 'no'  
- 'apply'  
- 'help'

It is not necessary to create of any part one dialog box. One can always use one of the preset ones:

$dialog = Gtk2::MessageDialog->new ($fenetre_parente,  
                                        $flags,$type,$bouton,..  
                                        $message);  

types may be :

- 'info'
- 'question'
- 'error'
- 'warrning'

    3.3. Notebooks

Notebooks is a way to handle multiple pages in a same window.

$onglets = Gtk2::Notebook->new();

To add a page to the notebook :

$onglets->append_page( $child, $tab_label );

The line above describes how to append a page, but there still is a way to prepend or insert à page between two other pages.

The operations on pages may be various:

$onglets->remove_page( $page_num );
$onglets->get_current_page();
$onglets->page_num( $child );
$onglets->next_page();
$onglets->prev_page();
...

    3.4. Progress Bars

The progress bars allow the visualization of the advance of a task.

$progress = Gtk2::ProgressBar->new();

We can modify the advance by updating the percentage of advance:

$progress->set_fraction($percentage );

Of course the bar can advance from left to right, from right to left, upwards and from top to bottom:

$progress->set_orientation( $orientation );

orientations are :

- 'left_to_right'
- 'right_to_left'
- 'bottom_to_top'
- 'top_to_bottom'

If a task cannot be sized it is often useful to show the activity of it rather than a false estimation:

$progress->pulse();
progress->set_pulse_step($fraction);

We can add a text to the bar :

$progress->set_text( $text );



Articles de la même catégorie

 Pages : Top


449 Visites
1 Commentaires
Réalisation d'un questionnaire médical sur PocketPC
[15 mn de lecture - paru le 10/7/2004 2:48:25 PM - Public : Débutant]

En savoir plus


429 Visites
0 Commentaires
Socle Technique EAI
[20 mn de lecture - paru le 10/7/2004 1:55:40 PM - Public : Confirmé]

En savoir plus


136 Visites
0 Commentaires
Framework EAI
[20 mn de lecture - paru le 10/7/2004 1:54:26 PM - Public : Confirmé]

En savoir plus

   Tous les Articles


SUPINFO Training Center peut vous proposer une formation ...

   Devenez Ingénieur Système Microsoft en 35 jours avec SUPINFO Training Center
   Devenez Certifiés Cisco en 13 jours avec SUPINFO Training Center
   Devenez Administrateur Système Microsoft avec SUPINFO Training Center
   Devenez Développeur Microsoft .NET en 13 jours avec SUPINFO Training Center



Powered by Campus-Booster Technology
Conditions d'utilisation & Copyright | Respect de la vie privée
© Copyright 1965-2006 Supinfo Paris, Paris Academy of Computer Science
Supinfo, Ecole Supérieure d'Informatique et Paris Academy Of Computer Science are trade marks.
23, rue de Château LANDON - 75010 PARIS - Phone : +33 (0) 153359 700 Fax : +33 (0) 153359 701

Web site autided by :