IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Interfaces Graphiques Perl Discussion :

[web] [Perl\Tk]Positioner la fenetre principale


Sujet :

Interfaces Graphiques Perl

  1. #1
    Membre actif Avatar de etranger
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    333
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Septembre 2004
    Messages : 333
    Points : 268
    Points
    268
    Par défaut [web] [Perl\Tk]Positioner la fenetre principale
    Bonsoir tout le monde

    j'aimerais savoir comment positioner la fenetre principal de mon application au milieu de l'ecran .

    j'ai chercher dans la doc mais l'anglais

    merci d'avance
    a+

  2. #2
    Expert éminent
    Avatar de Jedai
    Homme Profil pro
    Enseignant
    Inscrit en
    Avril 2003
    Messages
    6 245
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Avril 2003
    Messages : 6 245
    Points : 8 586
    Points
    8 586
    Par défaut
    L'anglais est une connaissance indispensable pour tout programmeur, tu aurais donc intérêt à te perfectionner dans cette langue aujourd'hui plus qu'utile... Sinon, voici deux fonctions qui vont t'aider :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    $widget->screenheight
        Returns a decimal string giving the height of $widget's screen, in pixels.
     
    $widget->screenwidth
        Returns a decimal string giving the width of $widget's screen, in pixels.
    Et il faut que tu utilises la fonction geometry() pour placer ta fenêtre ensuite :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    $toplevel->geometry(?newGeometry?)
        If newGeometry is specified, then the geometry of $toplevel is changed and an empty string is returned. Otherwise the current geometry for $toplevel is returned (this is the most recent geometry specified either by manual resizing or in a geometry method). NewGeometry has the form =widthxheight+-x+-y, where any of =, widthxheight, or +-x+-y may be omitted. Width and height are positive integers specifying the desired dimensions of $toplevel. If $toplevel is gridded (see GRIDDED GEOMETRY MANAGEMENT below) then the dimensions are specified in grid units; otherwise they are specified in pixel units. X and y specify the desired location of $toplevel on the screen, in pixels. If x is preceded by +, it specifies the number of pixels between the left edge of the screen and the left edge of $toplevel's border; if preceded by - then x specifies the number of pixels between the right edge of the screen and the right edge of $toplevel's border. If y is preceded by + then it specifies the number of pixels between the top of the screen and the top of $toplevel's border; if y is preceded by - then it specifies the number of pixels between the bottom of $toplevel's border and the bottom of the screen. If newGeometry is specified as an empty string then any existing user-specified geometry for $toplevel is cancelled, and the window will revert to the size requested internally by its widgets.
    Voilà, mais c'était pas trop dur à trouver, fait un effort, pour une fois qu'on a une doc un peu complète...

    --
    Jedaï

  3. #3
    Membre actif Avatar de etranger
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    333
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Septembre 2004
    Messages : 333
    Points : 268
    Points
    268
    Par défaut
    Merci Jedai

    Tu a raison j'ai un peut demander trop vite , sa faisaait juste un peut pres 16 heure que j'etait devant mon PC , mais apres avoir demander la question j'ai continuer a chercher et j'ai trouver la reponce (avec geometry ) , mais je me suis dit qu'une autre reponce serait peut etre meilleure .

    Sinon j'ai une autre question qui m'a l'air plus compliqué que la premiere :

    j'ai fait une application en utilisant TK , puis apres je la 'compile' avec Perl2exe , seulement dans mon application j'affiche une image (jpg) . j'aimerais savoir s'il etait possible d'inclure cette image dans mon exe , pour que je ne soit pas obliger de distribuer l'image a part .

    je vous remercie encor une foi , et j'attend (non je cherche) vos reponce pour cette deusieme question.

    Etranger

    EDIT : c'est bon j'ai trouver

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Fenetre principale
    Par benoit70 dans le forum MFC
    Réponses: 3
    Dernier message: 25/04/2005, 11h10
  2. Réponses: 15
    Dernier message: 17/01/2005, 17h08
  3. [web] [Perl/Tk] Pas d'insertion de texte !
    Par GLDavid dans le forum Interfaces Graphiques
    Réponses: 2
    Dernier message: 08/07/2004, 22h00
  4. [web] Perl et apache
    Par Laurent M dans le forum Web
    Réponses: 7
    Dernier message: 13/02/2004, 10h46
  5. [web] PERL TK
    Par martijan dans le forum Interfaces Graphiques
    Réponses: 5
    Dernier message: 27/06/2003, 08h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo