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 :

Glade + C +fichier xml


Sujet :

GTK+ avec C & C++

  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 111
    Par défaut Glade + C +fichier xml
    Bonjour à tous

    J'ai créé une interface sous glade. Ce dernier m'as bien généré le fichier xml.
    Par contre, lorsque je fais appel à ce dernier j'ai un problème : on dirait qu'il ne reconnait pas les widgets. Dans mon cas, il semble ne pas trouvé "window1" alors que cet identifiant existe dans mon fichier xml. Mon objet "window" dans le fichier interface.c vaut NULL.

    Fichier interface.c
    Code C : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    GtkWidget*
    create_window1 (void)
    {
    	GtkWidget *window;
    	GladeXML *gxml;
     
    	gxml = glade_xml_new ("test_xml2.glade", NULL, NULL);
     
    	/* This is important */
    	glade_xml_signal_autoconnect (gxml);
    	window = glade_xml_get_widget (gxml, "window1");
     
    	return window;
    }

    Fichier main.c
    Code C : 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
     
    /*
     * Initial main.c file generated by Glade. Edit as required.
     * Glade will not overwrite this file.
     */
     
    #ifdef HAVE_CONFIG_H
    #  include <config.h>
    #endif
     
    #include <gtk/gtk.h>
    #include <glade/glade.h>
     
     
    #include "interface.h"
    #include "support.h"
     
    #ifdef G_OS_WIN32
    gchar *package_prefix = PACKAGE_PREFIX;
    gchar *package_data_dir = PACKAGE_DATA_DIR;
    gchar *package_locale_dir = PACKAGE_LOCALE_DIR;
    #endif
     
    int
    main (int argc, char *argv[])
    {
      GtkWidget *window1;
     
      gchar *pixmap_dir;
     
    #ifdef G_OS_WIN32
      package_prefix = g_win32_get_package_installation_directory (NULL, NULL);
      package_data_dir = g_build_filename (package_prefix, "share", NULL);
      package_locale_dir = g_build_filename (package_prefix, "share", "locale", NULL);
    #endif
     
    #ifdef ENABLE_NLS
      bindtextdomain (GETTEXT_PACKAGE, package_locale_dir);
      bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
      textdomain (GETTEXT_PACKAGE);
    #endif
     
      gtk_set_locale ();
      gtk_init (&argc, &argv);
     
      pixmap_dir = g_build_filename (package_data_dir, PACKAGE, "pixmaps", NULL);
      add_pixmap_directory (pixmap_dir);
      g_free (pixmap_dir);
     
     
      /*
       * The following code was added by Glade to create one of each component
       * (except popup menus), just so that you see something after building
       * the project. Delete any components that you don't want shown initially.
       */
      window1 = create_window1 ();
      gtk_widget_show (window1);
      g_signal_connect ((gpointer) window1, "destroy", G_CALLBACK(gtk_main_quit),
                        NULL);
     
      gtk_main ();
     
    #ifdef G_OS_WIN32
      g_free (package_prefix);
      g_free (package_data_dir);
      g_free (package_locale_dir);
    #endif
     
      return 0;
    }
    #ifdef _MSC_VER
    #include <windows.h>
     
    int WINAPI WinMain(HINSTANCE hInstance,
                       HINSTANCE hPrevInstance,
                       LPSTR lpCmdLine,
                       int nCmdShow)
    {
      return main (__argc, __argv);
    }
    #endif

    Fichier xml
    Code C : 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
     
    <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
    <!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
     
    <glade-interface>
     
    <widget class="GtkWindow" id="window1">
      <property name="width_request">250</property>
      <property name="visible">True</property>
      <property name="title" translatable="yes">window1</property>
      <property name="type">GTK_WINDOW_TOPLEVEL</property>
      <property name="window_position">GTK_WIN_POS_NONE</property>
      <property name="modal">False</property>
      <property name="resizable">True</property>
      <property name="destroy_with_parent">False</property>
      <property name="decorated">False</property>
      <property name="skip_taskbar_hint">False</property>
      <property name="skip_pager_hint">False</property>
      <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
      <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
      <property name="focus_on_map">True</property>
      <property name="urgency_hint">False</property>
     
      <child>
        <widget class="GtkVBox" id="vbox1">
          <property name="visible">True</property>
          <property name="homogeneous">False</property>
          <property name="spacing">0</property>
     
          <child>
    	<widget class="GtkTable" id="table1">
    	  <property name="visible">True</property>
    	  <property name="n_rows">3</property>
    	  <property name="n_columns">3</property>
    	  <property name="homogeneous">False</property>
    	  <property name="row_spacing">0</property>
    	  <property name="column_spacing">0</property>
     
    	  <child>
    	    <widget class="GtkFrame" id="frame1">
    	      <property name="visible">True</property>
    	      <property name="label_xalign">0</property>
    	      <property name="label_yalign">0.5</property>
    	      <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
     
    	      <child>
    		<widget class="GtkAlignment" id="alignment1">
    		  <property name="visible">True</property>
    		  <property name="xalign">0.5</property>
    		  <property name="yalign">0.5</property>
    		  <property name="xscale">1</property>
    		  <property name="yscale">1</property>
    		  <property name="top_padding">0</property>
    		  <property name="bottom_padding">0</property>
    		  <property name="left_padding">0</property>
    		  <property name="right_padding">0</property>
     
    		  <child>
    		    <widget class="GtkTable" id="table2">
    		      <property name="visible">True</property>
    		      <property name="n_rows">1</property>
    		      <property name="n_columns">3</property>
    		      <property name="homogeneous">False</property>
    		      <property name="row_spacing">21</property>
    		      <property name="column_spacing">0</property>
     
    		      <child>
    			<widget class="GtkFixed" id="fixed15">
    			  <property name="width_request">5</property>
    			  <property name="visible">True</property>
    			</widget>
    			<packing>
    			  <property name="left_attach">2</property>
    			  <property name="right_attach">3</property>
    			  <property name="top_attach">0</property>
    			  <property name="bottom_attach">1</property>
    			  <property name="x_options">fill</property>
    			  <property name="y_options">fill</property>
    			</packing>
    		      </child>
     
    		      <child>
    			<widget class="GtkTable" id="table3">
    			  <property name="visible">True</property>
    			  <property name="n_rows">1</property>
    			  <property name="n_columns">2</property>
    			  <property name="homogeneous">False</property>
    			  <property name="row_spacing">0</property>
    			  <property name="column_spacing">9</property>
     
    			  <child>
    			    <widget class="GtkHBox" id="hbox1">
    			      <property name="visible">True</property>
    			      <property name="homogeneous">False</property>
    			      <property name="spacing">0</property>
     
    			      <child>
    				<widget class="GtkButton" id="btn_Moins">
    				  <property name="width_request">30</property>
    				  <property name="height_request">30</property>
    				  <property name="visible">True</property>
    				  <property name="can_focus">True</property>
    				  <property name="relief">GTK_RELIEF_NORMAL</property>
    				  <property name="focus_on_click">True</property>
    				  <signal name="clicked" handler="on_btn_Moins_clicked" object="hscale1" last_modification_time="Mon, 31 Mar 2008 12:10:34 GMT"/>
    				  <signal name="clicked" handler="on_btn_Moins_clicked2" last_modification_time="Mon, 31 Mar 2008 13:41:26 GMT"/>
     
    				  <child>
    				    <widget class="GtkImage" id="image2">
    				      <property name="visible">True</property>
    				      <property name="stock">gtk-media-rewind</property>
    				      <property name="icon_size">4</property>
    				      <property name="xalign">0.5</property>
    				      <property name="yalign">0.5</property>
    				      <property name="xpad">0</property>
    				      <property name="ypad">0</property>
    				    </widget>
    				  </child>
    				</widget>
    				<packing>
    				  <property name="padding">0</property>
    				  <property name="expand">False</property>
    				  <property name="fill">False</property>
    				</packing>
    			      </child>
     
    			      <child>
    				<widget class="GtkHScale" id="hscale1">
    				  <property name="visible">True</property>
    				  <property name="can_focus">True</property>
    				  <property name="draw_value">True</property>
    				  <property name="value_pos">GTK_POS_TOP</property>
    				  <property name="digits">0</property>
    				  <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
    				  <property name="inverted">False</property>
    				  <property name="adjustment">0 0 100 1 10 0</property>
    				  <signal name="change_value" handler="on_hscale1_change_value" object="btn_Plus" last_modification_time="Mon, 07 Apr 2008 09:11:33 GMT"/>
    				  <signal name="change_value" handler="on_hscale2_change_value" object="btn_Moins" last_modification_time="Mon, 07 Apr 2008 09:23:39 GMT"/>
    				  <signal name="button_release_event" handler="on_hscale1_button_release_event" object="btn_Plus" last_modification_time="Tue, 08 Apr 2008 13:32:50 GMT"/>
    				  <signal name="button_release_event" handler="on_hscale2_button_release_event" object="btn_Moins" last_modification_time="Tue, 08 Apr 2008 13:33:18 GMT"/>
    				</widget>
    				<packing>
    				  <property name="padding">0</property>
    				  <property name="expand">True</property>
    				  <property name="fill">True</property>
    				</packing>
    			      </child>
     
    			      <child>
    				<widget class="GtkButton" id="btn_Plus">
    				  <property name="visible">True</property>
    				  <property name="can_focus">True</property>
    				  <property name="relief">GTK_RELIEF_NORMAL</property>
    				  <property name="focus_on_click">True</property>
    				  <signal name="clicked" handler="on_btn_Plus_clicked" object="hscale1" last_modification_time="Mon, 31 Mar 2008 12:10:18 GMT"/>
    				  <signal name="clicked" handler="on_btn_Plus_clicked2" last_modification_time="Mon, 31 Mar 2008 13:41:35 GMT"/>
     
    				  <child>
    				    <widget class="GtkImage" id="image1">
    				      <property name="visible">True</property>
    				      <property name="stock">gtk-media-forward</property>
    				      <property name="icon_size">4</property>
    				      <property name="xalign">0.5</property>
    				      <property name="yalign">0.5</property>
    				      <property name="xpad">0</property>
    				      <property name="ypad">0</property>
    				    </widget>
    				  </child>
    				</widget>
    				<packing>
    				  <property name="padding">0</property>
    				  <property name="expand">False</property>
    				  <property name="fill">False</property>
    				</packing>
    			      </child>
    			    </widget>
    			    <packing>
    			      <property name="left_attach">1</property>
    			      <property name="right_attach">2</property>
    			      <property name="top_attach">0</property>
    			      <property name="bottom_attach">1</property>
    			    </packing>
    			  </child>
     
    			  <child>
    			    <widget class="GtkButton" id="btn_Auto">
    			      <property name="width_request">100</property>
    			      <property name="height_request">35</property>
    			      <property name="visible">True</property>
    			      <property name="can_focus">True</property>
    			      <property name="label" translatable="yes">&amp;Auto</property>
    			      <property name="use_underline">True</property>
    			      <property name="relief">GTK_RELIEF_NORMAL</property>
    			      <property name="focus_on_click">True</property>
    			    </widget>
    			    <packing>
    			      <property name="left_attach">0</property>
    			      <property name="right_attach">1</property>
    			      <property name="top_attach">0</property>
    			      <property name="bottom_attach">1</property>
    			      <property name="x_options"></property>
    			      <property name="y_options"></property>
    			    </packing>
    			  </child>
    			</widget>
    			<packing>
    			  <property name="left_attach">1</property>
    			  <property name="right_attach">2</property>
    			  <property name="top_attach">0</property>
    			  <property name="bottom_attach">1</property>
    			  <property name="y_options">expand</property>
    			</packing>
    		      </child>
     
    		      <child>
    			<widget class="GtkFixed" id="fixed14">
    			  <property name="width_request">5</property>
    			  <property name="height_request">5</property>
    			  <property name="visible">True</property>
    			</widget>
    			<packing>
    			  <property name="left_attach">0</property>
    			  <property name="right_attach">1</property>
    			  <property name="top_attach">0</property>
    			  <property name="bottom_attach">1</property>
    			  <property name="x_options"></property>
    			</packing>
    		      </child>
    		    </widget>
    		  </child>
    		</widget>
    	      </child>
     
    	      <child>
    		<widget class="GtkLabel" id="label1">
    		  <property name="visible">True</property>
    		  <property name="label" translatable="yes">&lt;b&gt;Focus&lt;/b&gt;</property>
    		  <property name="use_underline">False</property>
    		  <property name="use_markup">True</property>
    		  <property name="justify">GTK_JUSTIFY_RIGHT</property>
    		  <property name="wrap">False</property>
    		  <property name="selectable">False</property>
    		  <property name="xalign">0.5</property>
    		  <property name="yalign">1</property>
    		  <property name="xpad">16</property>
    		  <property name="ypad">0</property>
    		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
    		  <property name="width_chars">-1</property>
    		  <property name="single_line_mode">False</property>
    		  <property name="angle">0</property>
    		</widget>
    		<packing>
    		  <property name="type">label_item</property>
    		</packing>
    	      </child>
    	    </widget>
    	    <packing>
    	      <property name="left_attach">1</property>
    	      <property name="right_attach">2</property>
    	      <property name="top_attach">1</property>
    	      <property name="bottom_attach">2</property>
    	    </packing>
    	  </child>
     
    	  <child>
    	    <widget class="GtkFixed" id="fixed13">
    	      <property name="width_request">5</property>
    	      <property name="height_request">5</property>
    	      <property name="visible">True</property>
    	    </widget>
    	    <packing>
    	      <property name="left_attach">2</property>
    	      <property name="right_attach">3</property>
    	      <property name="top_attach">0</property>
    	      <property name="bottom_attach">1</property>
    	      <property name="x_options">fill</property>
    	      <property name="y_options">fill</property>
    	    </packing>
    	  </child>
     
    	  <child>
    	    <widget class="GtkFixed" id="fixed1">
    	      <property name="width_request">5</property>
    	      <property name="visible">True</property>
    	    </widget>
    	    <packing>
    	      <property name="left_attach">2</property>
    	      <property name="right_attach">3</property>
    	      <property name="top_attach">2</property>
    	      <property name="bottom_attach">3</property>
    	      <property name="x_options"></property>
    	      <property name="y_options"></property>
    	    </packing>
    	  </child>
     
    	  <child>
    	    <widget class="GtkFixed" id="fixed2">
    	      <property name="width_request">5</property>
    	      <property name="visible">True</property>
    	    </widget>
    	    <packing>
    	      <property name="left_attach">2</property>
    	      <property name="right_attach">3</property>
    	      <property name="top_attach">1</property>
    	      <property name="bottom_attach">2</property>
    	      <property name="x_options"></property>
    	      <property name="y_options"></property>
    	    </packing>
    	  </child>
     
    	  <child>
    	    <widget class="GtkFixed" id="fixed3">
    	      <property name="width_request">5</property>
    	      <property name="height_request">5</property>
    	      <property name="visible">True</property>
    	    </widget>
    	    <packing>
    	      <property name="left_attach">2</property>
    	      <property name="right_attach">3</property>
    	      <property name="top_attach">2</property>
    	      <property name="bottom_attach">3</property>
    	      <property name="x_options"></property>
    	      <property name="y_options"></property>
    	    </packing>
    	  </child>
     
    	  <child>
    	    <widget class="GtkFixed" id="fixed4">
    	      <property name="width_request">5</property>
    	      <property name="height_request">5</property>
    	      <property name="visible">True</property>
    	    </widget>
    	    <packing>
    	      <property name="left_attach">1</property>
    	      <property name="right_attach">2</property>
    	      <property name="top_attach">2</property>
    	      <property name="bottom_attach">3</property>
    	      <property name="x_options"></property>
    	      <property name="y_options"></property>
    	    </packing>
    	  </child>
     
    	  <child>
    	    <widget class="GtkFixed" id="fixed5">
    	      <property name="width_request">5</property>
    	      <property name="height_request">5</property>
    	      <property name="visible">True</property>
    	    </widget>
    	    <packing>
    	      <property name="left_attach">0</property>
    	      <property name="right_attach">1</property>
    	      <property name="top_attach">2</property>
    	      <property name="bottom_attach">3</property>
    	      <property name="x_options"></property>
    	      <property name="y_options"></property>
    	    </packing>
    	  </child>
     
    	  <child>
    	    <widget class="GtkFixed" id="fixed6">
    	      <property name="width_request">5</property>
    	      <property name="visible">True</property>
    	    </widget>
    	    <packing>
    	      <property name="left_attach">0</property>
    	      <property name="right_attach">1</property>
    	      <property name="top_attach">1</property>
    	      <property name="bottom_attach">2</property>
    	      <property name="x_options"></property>
    	      <property name="y_options"></property>
    	    </packing>
    	  </child>
     
    	  <child>
    	    <widget class="GtkFixed" id="fixed7">
    	      <property name="width_request">5</property>
    	      <property name="height_request">5</property>
    	      <property name="visible">True</property>
    	    </widget>
    	    <packing>
    	      <property name="left_attach">0</property>
    	      <property name="right_attach">1</property>
    	      <property name="top_attach">0</property>
    	      <property name="bottom_attach">1</property>
    	      <property name="x_options"></property>
    	      <property name="y_options"></property>
    	    </packing>
    	  </child>
     
    	  <child>
    	    <widget class="GtkFixed" id="fixed8">
    	      <property name="width_request">5</property>
    	      <property name="height_request">5</property>
    	      <property name="visible">True</property>
    	    </widget>
    	    <packing>
    	      <property name="left_attach">1</property>
    	      <property name="right_attach">2</property>
    	      <property name="top_attach">0</property>
    	      <property name="bottom_attach">1</property>
    	      <property name="x_options"></property>
    	      <property name="y_options"></property>
    	    </packing>
    	  </child>
    	</widget>
    	<packing>
    	  <property name="padding">0</property>
    	  <property name="expand">True</property>
    	  <property name="fill">True</property>
    	</packing>
          </child>
        </widget>
      </child>
    </widget>
     
    </glade-interface>

    Si qqn peut m'aider sur ce coup ça serait sympa.

    Merci

  2. #2
    Membre Expert
    Homme Profil pro
    Inscrit en
    Janvier 2005
    Messages
    1 259
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 1 259
    Par défaut
    Commence déjà par gérer les erreurs éventuelles, glade_xml_new peut renvoyer NULL s'il a un souci lors de l'ouverture du fichier glade.

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 111
    Par défaut
    Citation Envoyé par teuf13 Voir le message
    Commence déjà par gérer les erreurs éventuelles, glade_xml_new peut renvoyer NULL s'il a un souci lors de l'ouverture du fichier glade.
    Erreur de débutant et à cause de la rapidité d'exécution. Mon fichier n'était pas au bon niveau dans l'arborescence (../fichierxml).

    Désolé du dérangement. Evitez les copiez coller

  4. #4
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 111
    Par défaut
    J'ai réouvert le sujet car c'est dans la continuité.

    Je souhaite maintenant ajouté un widget à ma structure (fichier xml)

    Code C : 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
     
    GtkWidget*
    create_window1 (void)
    {
    	GtkWidget *window;
    	GladeXML *gxml;
    	GladeXML *gxml2;
    	GtkWidget *table1;
    	GtkWidget *objet;
     
    	gxml = glade_xml_new ("../test_xml1.glade", NULL, NULL);
    	gxml2 = glade_xml_new ("../test_xml2.glade", NULL, NULL);
     
    	/* This is important */
    	glade_xml_signal_autoconnect (gxml);
    	window = glade_xml_get_widget (gxml, "window1");
     
    	table1 = glade_xml_get_widget (gxml, "table1");
    	objet = glade_xml_get_widget (gxml2, "vbox1");
     
    	gtk_widget_show (objet);
    	gtk_container_add (GTK_CONTAINER(table1),objet);
     
    	return window;
    }

    La méthode gtk_container_add() ne fonctionne pas. Les deux objets se dessinent l'un sur l'autre et pas l'un dans l'autre.

    Vous allez me dire qu'il serait plus facile de modifier directement le fichier xml pour ajouter "un child". En fait le but de ma manoeuvre est de pouvoir ajouter un widjet créé par mes soins (cf topic dans le meme forum) de ce style

    Code C : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    GtkWidget *vbox11;
    controle2 *w_test3;
     
    w_test3=new controle2("<b>$Focus</b>","&Auto",310,100,0,100,1,10,0,0,0);
     
    vbox11 = w_test3->creer_fenetre();
    gtk_widget_show (vbox11);
    gtk_table_attach (GTK_TABLE (table3), vbox11, 1, 2, 0, 1,
                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

    Controle est une classe définit en C++. Cela marche parfaitement de cette manière. J'aimerais réaliser la meme chose en passant par le fichier xml c'est pourquoi j'essaie avec la méthode en haut de ce post. Après cela sera simple d'ajouter mon widget perso dans ce style:

    Code C : 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
     
     
    GtkWidget*
    create_window1 (void)
    {
    	GtkWidget *window;
    	GladeXML *gxml;
    	GtkWidget *table1;
    	GtkWidget *objet;
                 GtkWidget *vbox11;
                 controle2 *w_test3;
     
     
    	gxml = glade_xml_new ("../test_xml1.glade", NULL, NULL);
                 w_test3=new controle2("<b>$Focus</b>","&Auto",310,100,0,100,1,10,0,0,0);
     
     
    	glade_xml_signal_autoconnect (gxml);
    	window = glade_xml_get_widget (gxml, "window1");
                 objet = w_test3->creer_fenetre();
    	gtk_widget_show (objet);
    	gtk_container_add (GTK_CONTAINER(table1),objet); // méthode qui va bien pour intégrer un objet à un container
     
    	return window;
    }

  5. #5
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 111
    Par défaut
    Petite précision : C'était pas le bon widget "table" que je récupérais de test_xml1. Par contre, en récupérant le bon widget, le problème persiste.

    Mon objet table est bien configuré pour avoir plusieurs lignes (2 en l'occurence) et donc je souhaite insérer deux fois (un par ligne) l'objet que je récupère de fmon fichier test_xml3.

    Toujours personne ?

  6. #6
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 111
    Par défaut
    Bon ben finalement j'ai trouvé. Un conseil : Lisez bien la doc gtk à fond (même les petits trucs). Ne faites pas comme moi. Vous gagnerez pas mal de temps.

    Le problème venait de (cf http://library.gnome.org/devel/gtk/u...-container-add ) :
    A widget may be added to only one container at a time; you can't place the same widget inside two different containers.
    et oui je prenais deux fois l'objet "vbox1" du fichier test_xml3. Certes ils étaients sous des noms différents (objet et objet2) mais apparamment ça n'influent pas dessus. Pour gtk, ce sont les memes.

    Voilà le problème est résolu.

    PS: Je vais essayer d'aller plus loin avec l'utilisation des customs widgets ou essayer d'aller mettre directement mes objets dans le fichier xml avec des balises spéciales.

  7. #7
    Membre Expert
    Homme Profil pro
    Inscrit en
    Janvier 2005
    Messages
    1 259
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 1 259
    Par défaut
    Citation Envoyé par kenshi240683 Voir le message
    et oui je prenais deux fois l'objet "vbox1" du fichier test_xml3. Certes ils étaients sous des noms différents (objet et objet2) mais apparamment ça n'influent pas dessus. Pour gtk, ce sont les memes.
    Tu devais avoir des avertissements de la part de gtk+ à ce sujet dans la console d'où tu lances ton programme.

    Citation Envoyé par kenshi240683 Voir le message
    PS: Je vais essayer d'aller plus loin avec l'utilisation des customs widgets ou essayer d'aller mettre directement mes objets dans le fichier xml avec des balises spéciales.
    Un "custom widget", c'est une "classe" (au sens gtk+/gobject) qui dérive de GtkWidget, dans mon souvenir ça n'est pas le cas de ta classe controle2

  8. #8
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 111
    Par défaut
    Voici le code de ma classe (nota : controle, controle2, controle_ssbtn sont des classes formés de la même façon)

    fichier controle_ssbtn.cpp
    Code C : 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
     
    #include "controle_ssbtn.h"
    #include <gtk/gtk.h>
    #include <gtk/gtkwidget.h>
    #include "support.h"
    #include <config.h>
    #include <string.h>
     
    controle_ssbtn::controle_ssbtn(const gchar *label_frame, gint width_frame, gint height_frame, gdouble scale_min, gdouble scale_max, gdouble scale_step_increment, gdouble scale_page_increment, gdouble scale_page_size, gdouble scale_value_init, gdouble scale_value_auto, gint width_btn, gint height_btn){
    			this->label_frame=label_frame;
    			//this->label_bouton=label_bouton;
    			this->width_frame=width_frame;
    			this->height_frame=height_frame;
    			this->scale_min=scale_min;
    			this->scale_max=scale_max;
    			this->scale_step_increment=scale_step_increment;
    			this->scale_page_increment=scale_page_increment;
    			this->scale_page_size=scale_page_size;
    			this->scale_value_init=scale_value_init;
    			this->scale_value_auto=scale_value_auto;
    			//this->width_Auto=width_Auto;
    			//this->height_Auto=height_Auto;
    			this->width_btn=width_btn;
    			this->height_btn=height_btn;
    };
     
     
    GtkWidget* controle_ssbtn::creer_fenetre(){
     
      vbox1 = gtk_vbox_new (FALSE, 0);
      gtk_widget_show (vbox1);
      //gtk_container_add (GTK_CONTAINER (window1), vbox1);
     
      this->table1 = gtk_table_new (3, 3, FALSE);
      gtk_widget_show (this->table1);
      gtk_box_pack_start (GTK_BOX (this->vbox1), table1, TRUE, TRUE, 0);
     
      this->frame1 = gtk_frame_new (NULL);
      gtk_widget_show (this->frame1);
      gtk_table_attach (GTK_TABLE (this->table1), this->frame1, 1, 2, 1, 2,
                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
      gtk_widget_set_size_request (this->frame1, this->width_frame, this->height_frame);
     
      this->alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
      gtk_widget_show (this->alignment1);
      gtk_container_add (GTK_CONTAINER (this->frame1), this->alignment1);
     
      this->table2 = gtk_table_new (1, 3, FALSE);
      gtk_widget_show (this->table2);
      gtk_container_add (GTK_CONTAINER (this->alignment1), this->table2);
      gtk_table_set_row_spacings (GTK_TABLE (this->table2), 21);
     
      this->fixed11 = gtk_fixed_new ();
      gtk_widget_show (this->fixed11);
      gtk_table_attach (GTK_TABLE (this->table2), this->fixed11, 0, 1, 0, 1,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (GTK_FILL), 0, 0);
      gtk_widget_set_size_request (this->fixed11, 5, 5);
     
      this->fixed12 = gtk_fixed_new ();
      gtk_widget_show (this->fixed12);
      gtk_table_attach (GTK_TABLE (this->table2), this->fixed12, 2, 3, 0, 1,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (GTK_FILL), 0, 0);
      gtk_widget_set_size_request (this->fixed12, 5, -1);
     
      this->hbox1 = gtk_hbox_new (FALSE, 0);
      gtk_widget_show (this->hbox1);
      gtk_table_attach (GTK_TABLE (this->table2), this->hbox1, 1, 2, 0, 1,
                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                        (GtkAttachOptions) (GTK_EXPAND), 0, 0);
     
      this->btn_Moins = gtk_button_new ();
      gtk_widget_show (this->btn_Moins);
      gtk_box_pack_start (GTK_BOX (this->hbox1), this->btn_Moins, FALSE, FALSE, 0);
      gtk_widget_set_size_request (this->btn_Moins, this->width_btn, this->height_btn);
     
      this->image2 = gtk_image_new_from_stock ("gtk-media-rewind", GTK_ICON_SIZE_BUTTON);
      gtk_widget_show (this->image2);
      gtk_container_add (GTK_CONTAINER (this->btn_Moins), this->image2);
     
      this->hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (this->scale_value_init, this->scale_min, this->scale_max, this->scale_step_increment, this->scale_page_increment, this->scale_page_size)));
      gtk_widget_show (this->hscale1);
      gtk_box_pack_start (GTK_BOX (this->hbox1), this->hscale1, TRUE, TRUE, 0);
      gtk_scale_set_digits (GTK_SCALE (this->hscale1), 0);
     
      this->btn_Plus = gtk_button_new ();
      gtk_widget_show (this->btn_Plus);
      gtk_box_pack_start (GTK_BOX (this->hbox1), this->btn_Plus, FALSE, FALSE, 0);
      gtk_widget_set_size_request (this->btn_Plus, this->width_btn, this->height_btn);
     
      this->image1 = gtk_image_new_from_stock ("gtk-media-forward", GTK_ICON_SIZE_BUTTON);
      gtk_widget_show (this->image1);
      gtk_container_add (GTK_CONTAINER (this->btn_Plus), this->image1);
     
      this->label1 = gtk_label_new (this->label_frame);
      gtk_widget_show (this->label1);
      gtk_frame_set_label_widget (GTK_FRAME (this->frame1), this->label1);
      gtk_label_set_use_markup (GTK_LABEL (this->label1), TRUE);
      gtk_label_set_justify (GTK_LABEL (this->label1), GTK_JUSTIFY_RIGHT);
      gtk_misc_set_alignment (GTK_MISC (this->label1), 0.5, 1);
      gtk_misc_set_padding (GTK_MISC (this->label1), 16, 0);
     
      this->fixed13 = gtk_fixed_new ();
      gtk_widget_show (this->fixed13);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed13, 2, 3, 0, 1,
                        (GtkAttachOptions) (GTK_FILL),
                        (GtkAttachOptions) (GTK_FILL), 0, 0);
      gtk_widget_set_size_request (this->fixed13, 5, 5);
     
      this->fixed1 = gtk_fixed_new ();
      gtk_widget_show (this->fixed1);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed1, 2, 3, 2, 3,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed1, 5, -1);
     
      this->fixed2 = gtk_fixed_new ();
      gtk_widget_show (this->fixed2);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed2, 2, 3, 1, 2,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed2, 5, -1);
     
      this->fixed3 = gtk_fixed_new ();
      gtk_widget_show (this->fixed3);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed3, 2, 3, 2, 3,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed3, 5, 5);
     
      this->fixed4 = gtk_fixed_new ();
      gtk_widget_show (this->fixed4);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed4, 1, 2, 2, 3,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed4, 5, 5);
     
      this->fixed5 = gtk_fixed_new ();
      gtk_widget_show (this->fixed5);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed5, 0, 1, 2, 3,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed5, 5, 5);
     
      this->fixed6 = gtk_fixed_new ();
      gtk_widget_show (this->fixed6);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed6, 0, 1, 1, 2,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed6, 5, -1);
     
      this->fixed7 = gtk_fixed_new ();
      gtk_widget_show (this->fixed7);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed7, 0, 1, 0, 1,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed7, 5, 5);
     
      this->fixed8 = gtk_fixed_new ();
      gtk_widget_show (this->fixed8);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed8, 1, 2, 0, 1,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed8, 5, 5);
     
      g_signal_connect ((gpointer) this->btn_Moins, "clicked",
                        G_CALLBACK (controle_ssbtn::on_btn_Moins_clicked),
                        this);
      g_signal_connect ((gpointer) this->btn_Moins, "clicked",
                        G_CALLBACK (controle_ssbtn::on_btn_Moins_clicked2),
                        this);
      g_signal_connect ((gpointer) hscale1, "button_release_event",
                       G_CALLBACK (on_hscale_button_release_event),
                       this);
      g_signal_connect ((gpointer) this->btn_Plus, "clicked",
                        G_CALLBACK (controle_ssbtn::on_btn_Plus_clicked),
                        this);
      g_signal_connect ((gpointer) this->btn_Plus, "clicked",
                        G_CALLBACK (controle_ssbtn::on_btn_Plus_clicked2),
                        this);
     
       return GTK_WIDGET(this->vbox1);
    }
     
    void controle_ssbtn::on_btn_Moins_clicked (GtkButton *button, gpointer user_data){
    	((controle_ssbtn*)user_data)->real_btn_Moins_clicked ();
    }
     
    void controle_ssbtn::real_btn_Moins_clicked(){
    	//Déclarations
       gdouble iValue;
       gdouble value;
       GtkAdjustment *test;
     
       /* On active la bar de sélection*/
       gtk_widget_set_sensitive(GTK_WIDGET(this->hscale1), TRUE);
     
       /* Recuperation de la valeur de la scale */
       iValue = gtk_range_get_value(GTK_RANGE(this->hscale1));
     
       /* On récupère adjustement pour connaitre le step_increment*/
       test=gtk_range_get_adjustment(GTK_RANGE(this->hscale1));
     
       /* On calcule la nouvelle valeur*/
       value=iValue - test->step_increment;
     
       if (value>0.0 && value<100.0)
       {
    	    gtk_range_set_value(GTK_RANGE(this->hscale1),value);	
       }
       else{
    	   if (value<=0.0)
    	   {	
    		   gtk_range_set_value(GTK_RANGE(this->hscale1),value);	
    		   gtk_widget_set_sensitive(GTK_WIDGET(this->btn_Moins), FALSE);
    	   }
       }
    }
     
    void controle_ssbtn::on_btn_Plus_clicked (GtkButton *button, gpointer user_data){
    	((controle_ssbtn*)user_data)->real_btn_Plus_clicked ();
    }
     
    void controle_ssbtn::real_btn_Plus_clicked(){
    	//Déclarations
       gdouble iValue;
       gdouble value;
       GtkAdjustment *test;
     
       /* On active la bar de sélection*/
       gtk_widget_set_sensitive(GTK_WIDGET(this->hscale1), TRUE);
     
       /* Recuperation de la valeur de la scale */
       iValue = gtk_range_get_value(GTK_RANGE(this->hscale1));
     
       /* On récupère adjustement pour connaitre le step_increment*/
       test=gtk_range_get_adjustment(GTK_RANGE(this->hscale1));
     
       /* On calcule la nouvelle valeur*/
       value=iValue + test->step_increment;
     
       if (value>0.0 && value<100.0)
       {
    	    gtk_range_set_value(GTK_RANGE(this->hscale1),value);	
       }
       else
       {
    	   if (value >= 100.0)
    	   {
    		   gtk_range_set_value(GTK_RANGE(this->hscale1),value);	
    		   gtk_widget_set_sensitive(GTK_WIDGET(this->btn_Plus), FALSE);
    	   }
       }
    }
     
    void controle_ssbtn::on_btn_Moins_clicked2(GtkButton *button, gpointer user_data){
    	((controle_ssbtn*)user_data)->real_btn_Moins_clicked2 ();
    }
     
    void controle_ssbtn::real_btn_Moins_clicked2(){
    	// On récupère l'objet désiré 
          gtk_widget_set_sensitive (GTK_WIDGET(this->btn_Plus), TRUE);
    }
     
    void controle_ssbtn::on_btn_Plus_clicked2 (GtkButton *button, gpointer user_data){	
    	((controle_ssbtn*)user_data)->real_btn_Plus_clicked2 ();
    }
     
    void controle_ssbtn::real_btn_Plus_clicked2(){
    	// On récupère l'objet désiré 
       //GtkWidget * btn= lookup_widget(GTK_WIDGET(button),"btn_Moins");
     
       gtk_widget_set_sensitive (GTK_WIDGET(this->btn_Moins), TRUE);
    }
     
    gboolean controle_ssbtn::on_hscale_button_release_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data){	
    	gboolean val;
     
    	val = ((controle_ssbtn*)user_data)->real_hscale_button_release_event();
     
    	return val;
     
    }
     
    gboolean controle_ssbtn::real_hscale_button_release_event()
    {
     
    	gdouble iValue;
     
    	/* Recuperation de la valeur de la scrollbar */
       iValue = gtk_range_get_value(GTK_RANGE(this->hscale1));
     
       if (iValue==this->scale_max)
       {
    		gtk_widget_set_sensitive(GTK_WIDGET(this->btn_Plus), FALSE);
    		gtk_widget_set_sensitive(GTK_WIDGET(this->btn_Moins), TRUE);
       }
       if (iValue>this->scale_min && iValue<this->scale_max)
       {
    		gtk_widget_set_sensitive(GTK_WIDGET(this->btn_Moins), TRUE);
    		gtk_widget_set_sensitive(GTK_WIDGET(this->btn_Plus), TRUE);
       }
       if (iValue==this->scale_min)
       {
    		gtk_widget_set_sensitive(GTK_WIDGET(this->btn_Plus), TRUE);
    		gtk_widget_set_sensitive(GTK_WIDGET(this->btn_Moins), FALSE);
       }
     
      return FALSE;
    }

    fichier controle_ssbtn.h
    Code C : 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
     
    #ifndef __CONTROLE_SSBTN_H__
    #define __CONTROLE_SSBTN_H__
     
    #include <iostream.h>
     
    #define _cplusplus
    #include <gtk/gtk.h>
    #include <gtk/gtkwidget.h>
    #include <glade/glade.h>
    #include <glade/glade-build.h>
     
    class controle_ssbtn 
    {
    	private :
    		// Pour que l'on puisse considéré gtkConf comme un GtkWidget
     
    		//Objets de la classe
    		  GtkWidget *vbox1;
    		  GtkWidget *table1;
    		  GtkWidget *frame1;
    		  GtkWidget *alignment1;
    		  GtkWidget *table2;
    		  GtkWidget *fixed11;
    		  GtkWidget *fixed12;
    		  GtkWidget *hbox2;
    		  GtkWidget *fixed9;
    		  GtkWidget *fixed10;
    		  GtkWidget *hbox1;
    		  GtkWidget *btn_Moins;
    		  GtkWidget *image2;
    		  GtkWidget *hscale1;
    		  GtkWidget *btn_Plus;
    		  GtkWidget *image1;
    		  GtkWidget *label1;
    		  GtkWidget *fixed13;
    		  GtkWidget *fixed1;
    		  GtkWidget *fixed2;
    		  GtkWidget *fixed3;
    		  GtkWidget *fixed4;
    		  GtkWidget *fixed5;
    		  GtkWidget *fixed6;
    		  GtkWidget *fixed7;
    		  GtkWidget *fixed8;
     
     
     
    	   // Les noms du label de la frame et du bouton ( par défaut : AUTO)
    	   const gchar * label_frame;
     
    	   // Taille de la frame
    	   gint width_frame;
    	   gint height_frame;
     
    	   // Taille des autres boutons
    	   gint width_btn;
    	   gint height_btn;
     
    	   //Paramètres de la barre "scale"
    	   gdouble scale_min;
    	   gdouble scale_max;
    	   gdouble scale_step_increment;
    	   gdouble scale_page_increment;
    	   gdouble scale_page_size;
    	   gdouble scale_value_init;
     
    	   gdouble scale_value_auto;
     
     
    	public :
     
    		controle_ssbtn(const gchar *, gint, gint, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gint=30, gint=30);
     
    		~controle_ssbtn(){};
     
    		// Instructions permettant de définir les fonctions membres de la classe;
    		GtkWidget* creer_fenetre();
    		static void on_btn_Moins_clicked (GtkButton  *, gpointer );
    		static void on_btn_Plus_clicked (GtkButton *, gpointer );
    		static void on_btn_Moins_clicked2 (GtkButton *, gpointer );
    		static void on_btn_Plus_clicked2 (GtkButton *, gpointer );	
    		static gboolean on_hscale_button_release_event (GtkWidget *, GdkEventButton *, gpointer );
     
     
    	protected:
    		void real_btn_Moins_clicked();
    		void real_btn_Plus_clicked();
    		void real_btn_Moins_clicked2();
    		void real_btn_Plus_clicked2();
    		gboolean real_hscale_button_release_event();
     
    };
     
    #endif

    Voilà

    Maintenant, j'aimerais pouvoir récupérer les paramètres dont j'ai besoin pour mon constructeur directement du fichier xml (généré par glade puis modifier par mes soins ensuite afin d'ajouter les "customs widgets") dans ce genre :

    Partie rajouter par moi dans le fichier .glade créé par glade
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    <widget>
    				<class>controle_ssbtn<class>
    				<name>vbox9<name>
    				<label_frame>Contraste<label_frame>
    				<width_frame>250<width_frame>
    				<height_frame>100<height_frame>
    				<scale_min>0<scale_min>
    				<scale_max>100<scale_max>
    				<scale_step_increment>1<scale_step_increment>
    				<scale_page_increment>10<scale_page_increment>
    				<scale_page_size>0<scale_page_size>
    				<scale_value_init>0<scale_value_init>
    				<scale_value_auto>0<scale_value_auto>
    	                <widget>

    Si qqn a une solution je suis preneur

    Sachez que j'ai déjà commencé à chercher en utilisant les methodes :

    Code C : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    glade_register_widgets("controle_ssbtn", NewControle_ssbtn, NULL, NULL);

    Code C : 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
     
    GtkWidget *NewControle_ssbtn(GladeXML *xml, GladeWidgetInfo *info)
    {
        int width_frame = 0, height_frame = 0, width_btn = 0, height_btn = 0;
    	float scale_min = NULL , scale_max = NULL , scale_step_increment = NULL , scale_page_increment = NULL , scale_page_size = NULL , scale_value_init = NULL , scale_value_auto = NULL;
    	//string label_frame="";
        GList *attrlist = info->attributes;
    	controle_ssbtn *w_test2;
     
        while (attrlist) {
            GladeAttribute *attr = (GladeAttribute *)attrlist->data;
     
            /*if (strcmp(attr->name, "label_frame") == 0) {
                label_frame = "<b>" + attr->value + "</b>";
            } */
    		if (strcmp(attr->name, "width_frame") == 0) {
                width_frame = atoi(attr->value);
            }
    		if (strcmp(attr->name, "height_frame") == 0) {
                height_frame = atoi(attr->value);
            }
    		if (strcmp(attr->name, "scale_min") == 0) {
                scale_min = atof(attr->value);
            }
    		if (strcmp(attr->name, "scale_max") == 0) {
                scale_max = atof(attr->value);
            }
    		if (strcmp(attr->name, "scale_step_increment") == 0) {
                scale_step_increment = atof(attr->value);
            }
    		if (strcmp(attr->name, "scale_page_increment") == 0) {
                scale_page_increment = atof(attr->value);
            }
    		if (strcmp(attr->name, "scale_page_size") == 0) {
                scale_page_size = atof(attr->value);
            }
    		if (strcmp(attr->name, "scale_value_init") == 0) {
                scale_value_init = atof(attr->value);
            }
    		if (strcmp(attr->name, "scale_value_auto") == 0) {
                scale_value_auto = atof(attr->value);
            }
    		if (strcmp(attr->name, "width_btn") == 0) {
                width_btn = atoi(attr->value);
            }
    		if (strcmp(attr->name, "height_btn") == 0) {
                height_btn = atoi(attr->value);
            }
            attrlist = g_list_next(attrlist);
        }
        if (width_frame == 0 || height_frame == 0 ) {
            printf("Missing width_frame or height_frame for Controle_ssbtn %s\n", info->name);
            return NULL;
        }
    	if (scale_min == NULL || scale_max == NULL || scale_step_increment == NULL || scale_page_increment == NULL || scale_page_size == NULL || scale_value_init == NULL || scale_value_auto == NULL) {
            printf("Missing scale_min or scale_max or scale_step_increment or scale_page_increment or scale_page_size or scale_value_init or scale_value_auto for Controle_ssbtn %s\n", info->name);
            return NULL;
        }
    	/*if (label_frame="") {
            printf("Missing label_frame for Controle_ssbtn %s\n", info->name);
            return NULL;
        }*/
     
     
    	w_test2=new controle_ssbtn(label_frame, width_frame, height_frame, scale_min, scale_max, scale_step_increment, scale_page_increment, scale_page_size, scale_value_init, scale_value_auto, width_btn, height_btn);
        return w_test2->creer_fenetre();
    }

  9. #9
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 111
    Par défaut
    Bonjour à tous. cela fait longtemps que je n'étais pas revenu sur ce sujet.
    Maintenant, j'arrive à dessiner mes customs widgets à partir du fichier xml. Par contre il réside un petit problème: un seul widget semble se déssiner. Je m'explique:

    J'ai créé un nouveau type de widget. j'utilise la classe "GtkVBox" avec un nom préfixer ou pas en fonction s'il s'agit d'un custom widget ou pas.
    Ensuite GTK me créé bien l'objet mais m'affiche que le premier GtkVBox sur lequel il tombe.

    Si qqn peut m'aider sur ce coup !

  10. #10
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 111
    Par défaut
    Bonjour à tous !!

    Je me demande si cette discussion intéressait quelqu'un ou si tout simplement personne n'était en mesure de me répondre vu le manque d'activité de cette dernière.

    Pour ceux que cela intéresse je suis tout de même arrivé à une solution. On peut la qualifier de non finale car il manque certains aspects pour cela soit parfait mais certains points ne dépendent pas de cette dernière mais plutot du logiciel servant à la construction de l'interface (fichier xml) tel que glade.

    Pour remettre les idées au clair, je vais tout d'abord rappeller l'idée de cette discussion: on souhaitait créé un custom widget (pas forcément à la mode GTK) que l'on pourrait insérer dans les interfaces dessinées à l'aide d'un éditeur (ex:glade). Les paramètres nécessaires à l'implémentation devait provenir du fichier xml comme l'ensemble des widgets (GtkVBox, GtkTable,....)

    Voici la solution:
    - Créer une classe permettant de construire plusieurs instances d'un widgets ainsi que les méthodes associées (en C dans mon cas):
    Voici un morceau du code:
    Code C : 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
     
    #include "controle_ssbtn.h"
    #include <gtk/gtk.h>
    #include <gtk/gtkwidget.h>
    #include "support.h"
    #include <config.h>
    #include <string.h>
     
    controle_ssbtn::controle_ssbtn(const gchar *label_frame, gint width_frame, gint height_frame, gdouble scale_min, gdouble scale_max, gdouble scale_step_increment, gdouble scale_page_increment, gdouble scale_page_size, gdouble scale_value_init, gdouble scale_value_auto, gint width_btn, gint height_btn){
    			this->label_frame=label_frame;
    			this->width_frame=width_frame;
    			this->height_frame=height_frame;
    			this->scale_min=scale_min;
    			this->scale_max=scale_max;
    			this->scale_step_increment=scale_step_increment;
    			this->scale_page_increment=scale_page_increment;
    			this->scale_page_size=scale_page_size;
    			this->scale_value_init=scale_value_init;
    			this->scale_value_auto=scale_value_auto;
    			this->width_btn=width_btn;
    			this->height_btn=height_btn;
    };
     
     
    GtkWidget* controle_ssbtn::creer_fenetre(){
     
      vbox1 = gtk_vbox_new (FALSE, 0);
      gtk_widget_show (vbox1);
     
      this->table1 = gtk_table_new (3, 3, FALSE);
      gtk_widget_show (this->table1);
      gtk_box_pack_start (GTK_BOX (this->vbox1), table1, TRUE, TRUE, 0);
     
      this->frame1 = gtk_frame_new (NULL);
      gtk_widget_show (this->frame1);
      gtk_table_attach (GTK_TABLE (this->table1), this->frame1, 1, 2, 1, 2,
                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
      gtk_widget_set_size_request (this->frame1, this->width_frame, this->height_frame);
     
      this->alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
      gtk_widget_show (this->alignment1);
      gtk_container_add (GTK_CONTAINER (this->frame1), this->alignment1);
     
      this->table2 = gtk_table_new (1, 3, FALSE);
      gtk_widget_show (this->table2);
      gtk_container_add (GTK_CONTAINER (this->alignment1), this->table2);
      gtk_table_set_row_spacings (GTK_TABLE (this->table2), 21);
     
      this->fixed11 = gtk_fixed_new ();
      gtk_widget_show (this->fixed11);
      gtk_table_attach (GTK_TABLE (this->table2), this->fixed11, 0, 1, 0, 1,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (GTK_FILL), 0, 0);
      gtk_widget_set_size_request (this->fixed11, 5, 5);
     
      this->fixed12 = gtk_fixed_new ();
      gtk_widget_show (this->fixed12);
      gtk_table_attach (GTK_TABLE (this->table2), this->fixed12, 2, 3, 0, 1,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (GTK_FILL), 0, 0);
      gtk_widget_set_size_request (this->fixed12, 5, -1);
     
      this->hbox1 = gtk_hbox_new (FALSE, 0);
      gtk_widget_show (this->hbox1);
      gtk_table_attach (GTK_TABLE (this->table2), this->hbox1, 1, 2, 0, 1,
                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                        (GtkAttachOptions) (GTK_EXPAND), 0, 0);
     
      this->btn_Moins = gtk_button_new ();
      gtk_widget_show (this->btn_Moins);
      gtk_box_pack_start (GTK_BOX (this->hbox1), this->btn_Moins, FALSE, FALSE, 0);
      gtk_widget_set_size_request (this->btn_Moins, this->width_btn, this->height_btn);
     
      this->image2 = gtk_image_new_from_stock ("gtk-media-rewind", GTK_ICON_SIZE_BUTTON);
      gtk_widget_show (this->image2);
      gtk_container_add (GTK_CONTAINER (this->btn_Moins), this->image2);
     
      this->hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (this->scale_value_init, this->scale_min, this->scale_max, this->scale_step_increment, this->scale_page_increment, this->scale_page_size)));
      gtk_widget_show (this->hscale1);
      gtk_box_pack_start (GTK_BOX (this->hbox1), this->hscale1, TRUE, TRUE, 0);
      gtk_scale_set_digits (GTK_SCALE (this->hscale1), 0);
     
      this->btn_Plus = gtk_button_new ();
      gtk_widget_show (this->btn_Plus);
      gtk_box_pack_start (GTK_BOX (this->hbox1), this->btn_Plus, FALSE, FALSE, 0);
      gtk_widget_set_size_request (this->btn_Plus, this->width_btn, this->height_btn);
     
      this->image1 = gtk_image_new_from_stock ("gtk-media-forward", GTK_ICON_SIZE_BUTTON);
      gtk_widget_show (this->image1);
      gtk_container_add (GTK_CONTAINER (this->btn_Plus), this->image1);
     
      this->label1 = gtk_label_new (this->label_frame);
      gtk_widget_show (this->label1);
      gtk_frame_set_label_widget (GTK_FRAME (this->frame1), this->label1);
      gtk_label_set_use_markup (GTK_LABEL (this->label1), TRUE);
      gtk_label_set_justify (GTK_LABEL (this->label1), GTK_JUSTIFY_RIGHT);
      gtk_misc_set_alignment (GTK_MISC (this->label1), 0.5, 1);
      gtk_misc_set_padding (GTK_MISC (this->label1), 16, 0);
     
      this->fixed13 = gtk_fixed_new ();
      gtk_widget_show (this->fixed13);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed13, 2, 3, 0, 1,
                        (GtkAttachOptions) (GTK_FILL),
                        (GtkAttachOptions) (GTK_FILL), 0, 0);
      gtk_widget_set_size_request (this->fixed13, 5, 5);
     
      this->fixed1 = gtk_fixed_new ();
      gtk_widget_show (this->fixed1);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed1, 2, 3, 2, 3,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed1, 5, -1);
     
      this->fixed2 = gtk_fixed_new ();
      gtk_widget_show (this->fixed2);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed2, 2, 3, 1, 2,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed2, 5, -1);
     
      this->fixed3 = gtk_fixed_new ();
      gtk_widget_show (this->fixed3);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed3, 2, 3, 2, 3,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed3, 5, 5);
     
      this->fixed4 = gtk_fixed_new ();
      gtk_widget_show (this->fixed4);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed4, 1, 2, 2, 3,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed4, 5, 5);
     
      this->fixed5 = gtk_fixed_new ();
      gtk_widget_show (this->fixed5);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed5, 0, 1, 2, 3,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed5, 5, 5);
     
      this->fixed6 = gtk_fixed_new ();
      gtk_widget_show (this->fixed6);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed6, 0, 1, 1, 2,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed6, 5, -1);
     
      this->fixed7 = gtk_fixed_new ();
      gtk_widget_show (this->fixed7);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed7, 0, 1, 0, 1,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed7, 5, 5);
     
      this->fixed8 = gtk_fixed_new ();
      gtk_widget_show (this->fixed8);
      gtk_table_attach (GTK_TABLE (this->table1), this->fixed8, 1, 2, 0, 1,
                        (GtkAttachOptions) (0),
                        (GtkAttachOptions) (0), 0, 0);
      gtk_widget_set_size_request (this->fixed8, 5, 5);
     
      g_signal_connect ((gpointer) this->btn_Moins, "clicked",
                        G_CALLBACK (controle_ssbtn::on_btn_Moins_clicked),
                        this);
      g_signal_connect ((gpointer) this->btn_Moins, "clicked",
                        G_CALLBACK (controle_ssbtn::on_btn_Moins_clicked2),
                        this);
      g_signal_connect ((gpointer) hscale1, "button_release_event",
                       G_CALLBACK (on_hscale_button_release_event),
                       this);
      g_signal_connect ((gpointer) this->btn_Plus, "clicked",
                        G_CALLBACK (controle_ssbtn::on_btn_Plus_clicked),
                        this);
      g_signal_connect ((gpointer) this->btn_Plus, "clicked",
                        G_CALLBACK (controle_ssbtn::on_btn_Plus_clicked2),
                        this);
      return GTK_WIDGET(this->vbox1);
    }
     
    void controle_ssbtn::on_btn_Moins_clicked (GtkButton *button, gpointer user_data){
    	((controle_ssbtn*)user_data)->real_btn_Moins_clicked ();
    }
     
    void controle_ssbtn::real_btn_Moins_clicked(){
    .......   
    }
     
    void controle_ssbtn::on_btn_Plus_clicked (GtkButton *button, gpointer user_data){
    	((controle_ssbtn*)user_data)->real_btn_Plus_clicked ();
    }
     
    void controle_ssbtn::real_btn_Plus_clicked(){
    	...
    }
    P.S: la methode creer_fenetre peut etre simplifiée en "parsant" le fichier xml ,contenant l'interface du widget, directement .

    - Créer le fichier .h associé
    - Créer la méthode qui sera appelé lors que l'on "parsera" le fichier xml correspondant à l'interface totale du projet
    Code C : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    GtkWidget *NewControle_ssbtn(struct _GladeXML * w_gxml,unsigned long l,struct _GladeWidgetInfo * info)
    {
        GtkWidget *tempo;
     
    ....
     
        return GTK_WIDGET(tempo);
    }
    - Indiquer quand appeler cette méthode (register), le fichier xml à utiliser et ne pas oublier d'initialiser la libglade
    Code C : 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
     
    GtkWidget*
    create_window1 (void)
    {
     
    	GtkWidget *w_window;
     
    	GType w_rech;
     
    	glade_init();
    	w_rech=g_type_from_name("GtkVBox");
    	glade_register_widget(w_rech,NewControle_ssbtn,NULL,NULL);
    	w_gxml = glade_xml_new (FILENAME, NULL, "my-domain");
     
    	/* This is important */
    	glade_xml_signal_autoconnect (w_gxml);
    	w_window = glade_xml_get_widget (w_gxml, "window1");
     
    	return w_window;
    }

    Voici maintenant les différents points qui font que cette méthode n'est pas parfait à mon avis:
    - J'ai utilisé le GType "GtkVBox" dans la fonction glade_register_widget(). Le mieux serait de créer un nouveau GType pour chaque custom widget que l'on désire créer sinon vous devez utiliser un GType non utilisé dans votre projet.
    Si ce n'est pas le cas, il y aura un problème lors de la création de l'interface: dans mon cas, au départ, mon custom widget était dans une GtkVBox "normale" et il semblait yavoir un conflit ne permettant pas de dessiner mon custom widget. Dès que j'ai mis mon custom widget dans un autre container, le problème fut résolu.

    - Si on créé un nouveau Gtype pour un nouveau type de widget, il faut s'assurer que notre éditeur d'interface le gère. Sinon lors de la création du fichier xml, on aura un problème. On devra le modifier à la main sinon les modifications effectuées seront ecrasé par l'editeur lors de l'enregistrement.

    Voilà. En espérant avoir été assez clair.

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

Discussions similaires

  1. Réponses: 4
    Dernier message: 24/03/2009, 14h09
  2. Réponses: 4
    Dernier message: 23/03/2009, 21h10
  3. Intégration du fichier XML génère par Glade 3.4.5 ( interface GTK+)
    Par bilred dans le forum Développement 2D, 3D et Jeux
    Réponses: 0
    Dernier message: 22/03/2009, 09h53
  4. Réponses: 0
    Dernier message: 21/03/2009, 14h41
  5. [Glade] charger un fichier xml au choix
    Par debutanteVB.NET dans le forum Bibliothèques
    Réponses: 3
    Dernier message: 09/11/2005, 15h03

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