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

GTK+ avec C & C++ Discussion :

Organisation graphique logicielle.


Sujet :

GTK+ avec C & C++

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Février 2014
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2014
    Messages : 15
    Points : 8
    Points
    8
    Par défaut Organisation graphique logicielle.
    Bonjour à tous,

    je cherche à créer cette interface :
    Nom : interface5.jpg
Affichages : 151
Taille : 27,5 Ko

    Entre les bbox et les tables je n'arrive pas trop à m'organiser.
    la table ne peut pas accepter à le fois des objets de type boutons, et des objet muni d'une barre de scroll..

    Quelqu'un aurait une idée ?

  2. #2
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 291
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 291
    Points : 4 941
    Points
    4 941
    Billets dans le blog
    5
    Par défaut
    Je vais tenter de te faire un exemple, d'autant que je t'ai dit que c'était faisable dans ton post précédent .

  3. #3
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 291
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 291
    Points : 4 941
    Points
    4 941
    Billets dans le blog
    5
    Par défaut
    Voila ce que ca pourrait donner. Bien entendu il y a plusieurs façons d'arriver au même résultat :

    Nom : trombi.png
Affichages : 208
Taille : 23,6 Ko

    J'ai créé cette interface avec Glade 3. Le fichier xml se nome "interface.glade". Voila son code :
    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
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    <?xml version="1.0" encoding="UTF-8"?>
    <interface>
      <!-- interface-requires gtk+ 3.0 -->
      <object class="GtkListStore" id="liststore1">
        <columns>
          <!-- column-name liste1 -->
          <column type="gchararray"/>
        </columns>
        <data>
          <row>
            <col id="0" translatable="yes">entree 1</col>
          </row>
          <row>
            <col id="0" translatable="yes">entree 2</col>
          </row>
          <row>
            <col id="0" translatable="yes">entree 3</col>
          </row>
          <row>
            <col id="0" translatable="yes">...</col>
          </row>
        </data>
      </object>
      <object class="GtkWindow" id="mainwindow">
        <property name="can_focus">False</property>
        <property name="hexpand">True</property>
        <property name="vexpand">True</property>
        <property name="title" translatable="yes">Trombinoscope</property>
        <child>
          <object class="GtkBox" id="box1">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="hexpand">True</property>
            <property name="vexpand">True</property>
            <property name="orientation">vertical</property>
            <child>
              <object class="GtkBox" id="box2">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="hexpand">True</property>
                <property name="spacing">4</property>
                <child>
                  <object class="GtkImage" id="image5">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="stock">gtk-orientation-landscape</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">0</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkLabel" id="label3">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="label" translatable="yes">Super trombinoscope</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkImage" id="image6">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="halign">end</property>
                    <property name="hexpand">True</property>
                    <property name="stock">gtk-stop</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">2</property>
                  </packing>
                </child>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkSeparator" id="separator1">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="padding">6</property>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkGrid" id="grid1">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="hexpand">True</property>
                <property name="vexpand">True</property>
                <child>
                  <object class="GtkLabel" id="label1">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="xalign">0</property>
                    <property name="label" translatable="yes">Fichier source</property>
                  </object>
                  <packing>
                    <property name="left_attach">0</property>
                    <property name="top_attach">0</property>
                    <property name="width">2</property>
                    <property name="height">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkLabel" id="label2">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="xalign">0</property>
                    <property name="label" translatable="yes">Filtre</property>
                  </object>
                  <packing>
                    <property name="left_attach">0</property>
                    <property name="top_attach">1</property>
                    <property name="width">1</property>
                    <property name="height">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkButton" id="button1">
                    <property name="label" translatable="yes">Exporte liste</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">True</property>
                    <property name="halign">start</property>
                  </object>
                  <packing>
                    <property name="left_attach">0</property>
                    <property name="top_attach">5</property>
                    <property name="width">1</property>
                    <property name="height">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkButton" id="button2">
                    <property name="label" translatable="yes">Sauver liste</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">True</property>
                    <property name="halign">start</property>
                  </object>
                  <packing>
                    <property name="left_attach">1</property>
                    <property name="top_attach">5</property>
                    <property name="width">1</property>
                    <property name="height">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkTreeView" id="treeview1">
                    <property name="height_request">240</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="margin_left">5</property>
                    <property name="margin_right">5</property>
                    <property name="margin_top">5</property>
                    <property name="hexpand">True</property>
                    <property name="vexpand">True</property>
                    <property name="model">liststore1</property>
                    <property name="search_column">5</property>
                    <child>
                      <object class="GtkTreeViewColumn" id="treeviewcolumn1">
                        <property name="title" translatable="yes">Liste Pour trombinoscope</property>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="left_attach">0</property>
                    <property name="top_attach">3</property>
                    <property name="width">2</property>
                    <property name="height">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkButton" id="button3">
                    <property name="label" translatable="yes">Exporte trombi</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">True</property>
                    <property name="halign">start</property>
                  </object>
                  <packing>
                    <property name="left_attach">3</property>
                    <property name="top_attach">5</property>
                    <property name="width">1</property>
                    <property name="height">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkSeparator" id="separator2">
                    <property name="width_request">19</property>
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="orientation">vertical</property>
                  </object>
                  <packing>
                    <property name="left_attach">2</property>
                    <property name="top_attach">0</property>
                    <property name="width">1</property>
                    <property name="height">4</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkSeparator" id="separator3">
                    <property name="height_request">14</property>
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                  </object>
                  <packing>
                    <property name="left_attach">0</property>
                    <property name="top_attach">4</property>
                    <property name="width">5</property>
                    <property name="height">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkScrolledWindow" id="scrolledwindow1">
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="hexpand">True</property>
                    <property name="hscrollbar_policy">never</property>
                    <property name="vscrollbar_policy">always</property>
                    <property name="shadow_type">in</property>
                    <child>
                      <object class="GtkViewport" id="viewport1">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="valign">start</property>
                        <property name="shadow_type">out</property>
                        <child>
                          <object class="GtkGrid" id="grid2">
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <property name="orientation">vertical</property>
                            <property name="row_spacing">5</property>
                            <property name="column_spacing">5</property>
                            <property name="row_homogeneous">True</property>
                            <property name="column_homogeneous">True</property>
                            <child>
                              <object class="GtkImage" id="image1">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-orientation-landscape</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">0</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image2">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-convert</property>
                              </object>
                              <packing>
                                <property name="left_attach">2</property>
                                <property name="top_attach">0</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image3">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-home</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">2</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image4">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-justify-center</property>
                              </object>
                              <packing>
                                <property name="left_attach">2</property>
                                <property name="top_attach">2</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image7">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">4</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image8">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">2</property>
                                <property name="top_attach">4</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image9">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">6</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image10">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">2</property>
                                <property name="top_attach">6</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <object class="GtkImage" id="image11">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">8</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image12">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">2</property>
                                <property name="top_attach">8</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image13">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">10</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image14">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">2</property>
                                <property name="top_attach">10</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image15">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">12</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image16">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">2</property>
                                <property name="top_attach">12</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image17">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">14</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image18">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">2</property>
                                <property name="top_attach">14</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image19">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">16</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkImage" id="image20">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="stock">gtk-missing-image</property>
                              </object>
                              <packing>
                                <property name="left_attach">2</property>
                                <property name="top_attach">16</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="left_attach">3</property>
                    <property name="top_attach">2</property>
                    <property name="width">2</property>
                    <property name="height">2</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkFrame" id="frame1">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="margin_left">5</property>
                    <property name="margin_right">5</property>
                    <property name="margin_top">5</property>
                    <property name="margin_bottom">5</property>
                    <property name="label_xalign">0</property>
                    <child>
                      <object class="GtkAlignment" id="alignment1">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="left_padding">12</property>
                        <child>
                          <object class="GtkTreeView" id="treeview2">
                            <property name="visible">True</property>
                            <property name="can_focus">True</property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child type="label">
                      <object class="GtkLabel" id="label4">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="label" translatable="yes">&lt;b&gt;Critères&lt;/b&gt;</property>
                        <property name="use_markup">True</property>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="left_attach">0</property>
                    <property name="top_attach">2</property>
                    <property name="width">1</property>
                    <property name="height">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkFrame" id="frame2">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="margin_left">5</property>
                    <property name="margin_right">5</property>
                    <property name="margin_top">5</property>
                    <property name="margin_bottom">5</property>
                    <property name="label_xalign">0</property>
                    <child>
                      <object class="GtkAlignment" id="alignment2">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="left_padding">12</property>
                        <child>
                          <object class="GtkTreeView" id="treeview3">
                            <property name="height_request">100</property>
                            <property name="visible">True</property>
                            <property name="can_focus">True</property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child type="label">
                      <object class="GtkLabel" id="label5">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="label" translatable="yes">&lt;b&gt;List associée&lt;/b&gt;</property>
                        <property name="use_markup">True</property>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="left_attach">1</property>
                    <property name="top_attach">2</property>
                    <property name="width">1</property>
                    <property name="height">1</property>
                  </packing>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">2</property>
              </packing>
            </child>
          </object>
        </child>
      </object>
    </interface>
    Le code source pour l'utiliser : (J'ai écrit ce code minimaliste. Il ne vérifie pas l'état des buffers utilisés).
    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
    #include <gtk/gtk.h>
     
    int main(int argc,char **argv)
    {
        GtkWidget *mainwindow = NULL;
    		GtkBuilder *builder = NULL;
     
        gtk_init(&argc,&argv);
     
    		// Chargement de l'interface construite avec Glade 3
    		builder = gtk_builder_new ();
    		gtk_builder_add_from_file (builder, "./interface.glade", NULL);
     
    		// Récupération du pointeur de la fenêtre principale pour affichage
    		mainwindow = (GtkWidget*)gtk_builder_get_object (builder,"mainwindow");
     
    		// Assignation de la fonction gtk_main_quit(); au signal "destroy"
    		g_signal_connect (G_OBJECT (mainwindow), "destroy", (GCallback)gtk_main_quit, NULL);
     
    		// Affichage de l'interface principale
        gtk_widget_show_all(mainwindow);
     
    		// Lancement de la boucle principale Gtk+
        gtk_main();
     
        return 0;
    }

  4. #4
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Février 2014
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2014
    Messages : 15
    Points : 8
    Points
    8
    Par défaut
    Merci gerald3d
    Vraiment génial Glade, j'en avais jamais entendu parler.

    Ca compile correctement, cependant lors de l'exécution, la console m'indique :
    Nom : erreurGlade.png
Affichages : 245
Taille : 39,0 Ko

    J'utilise Gtk2 sous windows.

  5. #5
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 291
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 291
    Points : 4 941
    Points
    4 941
    Billets dans le blog
    5
    Par défaut
    Ton erreur vient sûrement du fait que tu utilises Gtk+2.0. Le code xml est généré pour Gtk+3.0 !

    Je vais voir s'il n'est pas possible de demander à Glade de générer un code xml pour la v2.0...

  6. #6
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 291
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 291
    Points : 4 941
    Points
    4 941
    Billets dans le blog
    5
    Par défaut
    Malheureusement je ne peux pas downgrader le fichier xml. Par contre j'ai trouvé ce lien pour utiliser glade3 sous windows, si ca peu t'aider : http://sourceforge.net/projects/gladewin32/

  7. #7
    Modérateur

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2009
    Messages
    1 395
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2009
    Messages : 1 395
    Points : 2 002
    Points
    2 002
    Par défaut
    Tu ne peux pas downgrader (déjà parce que certains widgets pourraient ne plus exister). À ma connaissance il y a des versions de Glade séparées, une ancienne pour GTK 2, une autre pour GTK 3.
    Documentation officielle GTK+ 3:
    GTK en C, GTK en Python

    Tutoriels GTK+ 3:
    GTK en C, GTK en Python

    Tutoriels par l'exemple (platform-demos):
    GTK (tous langages)

  8. #8
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 291
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 291
    Points : 4 941
    Points
    4 941
    Billets dans le blog
    5
    Par défaut
    Citation Envoyé par liberforce Voir le message
    Tu ne peux pas downgrader (déjà parce que certains widgets pourraient ne plus exister). À ma connaissance il y a des versions de Glade séparées, une ancienne pour GTK 2, une autre pour GTK 3.
    J'ai cherché à installer Glade 2 mais il n'est plus dans la liste Debian.

  9. #9
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Février 2014
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2014
    Messages : 15
    Points : 8
    Points
    8
    Par défaut
    J'ai réussi à me faire mon propore .xml avec glade, qui fonctionne ! Cependant un problème se pose : comment gérer les callback ? j'ai regardé ton tuto, mais que dois je ajouter au linker (codeblocks) vu que windows ne gère pas les paquets ?

    Sinon quel widget as tu utilisé pour la liste d'image à droite ?

  10. #10
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 291
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 291
    Points : 4 941
    Points
    4 941
    Billets dans le blog
    5
    Par défaut
    Comme je vois que tu t'intéresses à Glade je t'invite à aller faire un tour sur un super tuto. Tu trouveras le lien dans ma signature (http://gerald3d.developpez.com/). Sinon pour faire simple les callbacks sont gérés directement par GtkBuilder. Tu peux sinon les déclarer directement dans ton code source.

    Pour la liste d'images j'ai simplement insérer un GtkGrid (pour toi ca serait un GtkTable) dans un GtkViewport qui lui-même est inséré dans un GtkScrolledWindow.

  11. #11
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Février 2014
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2014
    Messages : 15
    Points : 8
    Points
    8
    Par défaut
    Du fait que je suis sous windows, je ne pense pas pouvoir gérer les signaux à partir de glade, étant donné que je n'ai pas la gestion des paquets et que je ne sais pas du tout quoi linker dans mon codeblocks.

    En revanche je me demande comment on peut faire de l'affichage conditionnel. Par exemple, je clique sur un bouton A, une partie de mon interface affiche un menu.
    Si je clique sur un bouton B, cette même partie d'interface affiche un autre menu.
    Est-ce faisable depuis glade ?

  12. #12
    Modérateur

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2009
    Messages
    1 395
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2009
    Messages : 1 395
    Points : 2 002
    Points
    2 002
    Par défaut
    Pour gérer les callbacks à partir du fichier xml, il faut te lier à gmodule. La doc de gtk_builder_connect_signals te dit tout ce dont tu as besoin.
    Pour ce qui est de l'affichage conditionnel, là ça devient de la logique de ton programme, et c'est à faire dans la callback.
    Documentation officielle GTK+ 3:
    GTK en C, GTK en Python

    Tutoriels GTK+ 3:
    GTK en C, GTK en Python

    Tutoriels par l'exemple (platform-demos):
    GTK (tous langages)

  13. #13
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Février 2014
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2014
    Messages : 15
    Points : 8
    Points
    8
    Par défaut
    Merci beaucoup !

    J'ai réussi à faire pas mal de chose avec les callback. Cependant je n'ai pas réussi à exploiter la fenêtre d'ouverture de fichier (FileChooserDialog) : lorsque je clique sur le bouton d'ouverture de fichier (File Chooser Button, ajouté avec glade dans l'interface), une fenêtre FileChooserDialog apparaît. Mais je n'ai aucun accès au code de cette fenêtre. Aucun signal, aucun nom, rien.
    Du coup je ne peut pas accéder au nom du fichier choisi..

    Vous avez une idée ?

  14. #14
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 291
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 291
    Points : 4 941
    Points
    4 941
    Billets dans le blog
    5
    Par défaut
    Ici je dirai de connecter un callback au signal "file-set" du GtkFileChooserButton. Dans le callback tu peux alors utiliser la fonction gchar *gtk_file_chooser_get_filename (GtkFileChooser *chooser); pour récupérer le chemin complet du fichier sélectionné.

  15. #15
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Février 2014
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2014
    Messages : 15
    Points : 8
    Points
    8
    Par défaut
    Oui voilà, c'est ce que j'ai essayé, mais je n'ai pas le GtkFileChooser *chooser.
    Il n'apparaît ni dans glade ni dans le .xml.
    Pourtant il existe forcément vu qu'il apparaît lorsque je clique sur le GtkFileChooserButton ..
    :\

  16. #16
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 291
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 291
    Points : 4 941
    Points
    4 941
    Billets dans le blog
    5
    Par défaut
    Si je ne dis pas de bêtise tu peux transtyper GtkFileChooserButton* en GtkFileChooser*.

  17. #17
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Février 2014
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2014
    Messages : 15
    Points : 8
    Points
    8
    Par défaut
    Je comprends vraiment pas pourquoi, mais ton idée fonctionne très bien ^^

  18. #18
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 291
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 291
    Points : 4 941
    Points
    4 941
    Billets dans le blog
    5
    Par défaut
    Citation Envoyé par vykernes Voir le message
    Je comprends vraiment pas pourquoi, mais ton idée fonctionne très bien ^^
    Je voulais te donner le lien de la doc. officielle mais je n'y accède plus (les voix du Net sont impénétrables ). Ceci étant voila un copier/coller de la doc locale :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Implemented Interfaces
     
    GtkFileChooserButton implements AtkImplementorIface, GtkBuildable, GtkOrientable and GtkFileChooser.
    Tout est dit

  19. #19
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Février 2014
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2014
    Messages : 15
    Points : 8
    Points
    8
    Par défaut
    Sur la partie de droite Nom : int.jpg
Affichages : 182
Taille : 27,2 Ko, je suis censé avoir une liste de groupes, et dans ces groupes une liste de membres avec leur photo. Le nombre de groupes et les membres parmi ces groupes sont fonction des critères sélectionnés. Du coup je suis obligé de faire un affichage dynamique.
    J'imagine que le mieux est de créer et de détruire les box directement dans le .c au lieu de le faire dans glade, non ? Car dans glade je serait obligé d'allouer un grand nombre de box pour être prêt à toute éventualité.

    Qu'en penses-tu ?

  20. #20
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 291
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 291
    Points : 4 941
    Points
    4 941
    Billets dans le blog
    5
    Par défaut
    À partir du moment où tu ne connais pas à l'avance le nombre d'éléments il te faut adapter les widgets à la volée. Soit tu utilises une liste que tu mets à jour en fonction des choix, soit tu utilises un GtkTable inséré dans un GtkScroledWindow pour les images par exemple. Si les critères changent, tu détruis le GtkTable et tu en insères un nouveau, tout simplement si on peut dire .

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. choix carte graphique logiciel 3D
    Par onizuka159 dans le forum Composants
    Réponses: 7
    Dernier message: 02/06/2007, 01h26
  2. [VB2005] Comment organiser son logiciel ?
    Par Pouille69 dans le forum Windows Forms
    Réponses: 6
    Dernier message: 18/05/2007, 18h24
  3. Petit logiciel graphique pour faire des Onglets
    Par javaSudOuest dans le forum Autres Logiciels
    Réponses: 4
    Dernier message: 18/10/2005, 14h39
  4. Réponses: 4
    Dernier message: 19/09/2005, 17h56
  5. [conseil logiciel] Représentation graphique d'une BDD
    Par ShinJava dans le forum Décisions SGBD
    Réponses: 2
    Dernier message: 27/02/2005, 08h41

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