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

Tkinter Python Discussion :

Créer une scrollbar


Sujet :

Tkinter Python

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Mars 2010
    Messages
    51
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2010
    Messages : 51
    Par défaut Créer une scrollbar
    Bonjour,

    Je suis en train d'étudier la question d'une scrollbar Tkinter. En fait, je vais intégrer un tableau à une fenêtre Tkinter qui va comprendre 4 colonnes et jusqu'à 60 lignes. Je joint un bout de code avec un exemple du genre de choses que je veux intégrer dans mon programme. Il s'agit de pouvoir faire défiler la scrollbar de sorte de pouvoir voir tout les boutons. Comment puis je faire?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    from Tkinter import *
     
    fen1=Tk()
     
    can1=Canvas(fen1,bg='white')
    can1.pack()
    s1=Scrollbar(can1)
    s1.pack(side=RIGHT)
    can1.config(yscrollcommand=s1.set)
     
    b1=Button(can1,text='Salut1').pack()
    b2=Button(can1,text='Salut').pack()
    b3=Button(can1,text='Salut').pack()
    b4=Button(can1,text='Salut').pack()
    b5=Button(can1,text='Salut5').pack()
    b6=Button(can1,text='Salut').pack()
    b7=Button(can1,text='Salut').pack()
    b8=Button(can1,text='Salut').pack()
    b9=Button(can1,text='Salut').pack()
    b10=Button(can1,text='Salut10').pack()
    b11=Button(can1,text='Salut').pack()
    b12=Button(can1,text='Salut').pack()
    b13=Button(can1,text='Salut').pack()
    b14=Button(can1,text='Salut').pack()
    b15=Button(can1,text='Salut15').pack()
    b16=Button(can1,text='Salut').pack()
    b17=Button(can1,text='Salut').pack()
    b18=Button(can1,text='Salut').pack()
    b19=Button(can1,text='Salut').pack()
    b20=Button(can1,text='Salut20').pack()
    b21=Button(can1,text='Salut').pack()
    b22=Button(can1,text='Salut').pack()
    b23=Button(can1,text='Salut').pack()
    b24=Button(can1,text='Salut').pack()
    b25=Button(can1,text='Salut25').pack()
    b26=Button(can1,text='Salut').pack()
    b27=Button(can1,text='Salut').pack()
    b28=Button(can1,text='Salut').pack()
    b29=Button(can1,text='Salut').pack()
    b30=Button(can1,text='Salut30').pack()
    b31=Button(can1,text='Salut').pack()
    b32=Button(can1,text='Salut').pack()
    b33=Button(can1,text='Salut').pack()
    b34=Button(can1,text='Salut').pack()
    b35=Button(can1,text='Salut35').pack()
    b36=Button(can1,text='Salut').pack()
    b37=Button(can1,text='Salut').pack()
    b38=Button(can1,text='Salut').pack()
    b39=Button(can1,text='Salut').pack()
    b40=Button(can1,text='Salut40').pack()
    b41=Button(can1,text='Salut').pack()
    b42=Button(can1,text='Salut').pack()
    b43=Button(can1,text='Salut').pack()
    b44=Button(can1,text='Salut').pack()
    b45=Button(can1,text='Salut45').pack()
    b46=Button(can1,text='Salut').pack()
    b47=Button(can1,text='Salut').pack()
    b48=Button(can1,text='Salut').pack()
    b49=Button(can1,text='Salut').pack()
    b50=Button(can1,text='Salut50').pack()
    b51=Button(can1,text='Salut').pack()
    b52=Button(can1,text='Salut').pack()
    b53=Button(can1,text='Salut').pack()
    b54=Button(can1,text='Salut').pack()
    b55=Button(can1,text='Salut55').pack()
    b56=Button(can1,text='Salut').pack()
    b57=Button(can1,text='Salut').pack()
    b58=Button(can1,text='Salut').pack()
    b59=Button(can1,text='Salut').pack()
    b60=Button(can1,text='Salut60').pack()
     
    s1.config(command=can1.yview)
     
    fen1.mainloop()
    Merci pour votre aide

  2. #2
    Membre Expert Avatar de PauseKawa
    Homme Profil pro
    Technicien Help Desk, maintenance, réseau, système et +
    Inscrit en
    Juin 2006
    Messages
    2 725
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Technicien Help Desk, maintenance, réseau, système et +
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2006
    Messages : 2 725
    Par défaut
    Bonjour,

    Regarde ici

    @+

Discussions similaires

  1. []Créer une scrollbar
    Par AsmCode dans le forum VB 6 et antérieur
    Réponses: 2
    Dernier message: 30/09/2005, 09h32
  2. [Réseau] Créer une connexion Internet
    Par Tranber dans le forum VB 6 et antérieur
    Réponses: 11
    Dernier message: 17/10/2002, 17h01
  3. Créer une fenêtre flottante qui ne peut avoir le focus
    Par BestofMac dans le forum Composants VCL
    Réponses: 4
    Dernier message: 17/07/2002, 10h46
  4. Peux t'on créer une copie locale de l'objet partagé?
    Par Anonymous dans le forum CORBA
    Réponses: 8
    Dernier message: 16/04/2002, 16h20

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