Developpement de panel GTK

Signaler
Messages postés
7
Date d'inscription
vendredi 8 décembre 2000
Statut
Membre
Dernière intervention
21 avril 2009
-
Messages postés
7
Date d'inscription
vendredi 8 décembre 2000
Statut
Membre
Dernière intervention
21 avril 2009
-
Bonjour,
je suis en train de développer un projet sur la base de Wireshark. Pour mon projet, je dois ajouter un nouveau panel au sein de la fenêtre de Wireshark. Mon problème est que j'arrive a insérer ma fenêtre mais du coup un panel d'origine de wireshark ne s'affiche plus. Est ce que vous pouvez me venir en aide :
Voici la fonction qui devrait servir d'affichage :
/*

* Rearrange the main window widgets

*/

void

main_widgets_rearrange(
void) {GtkWidget *first_pane_widget1, *first_pane_widget2;

GtkWidget *second_pane_widget1, *second_pane_widget2;

gboolean split_top_left;

/* be a bit faster */gtk_widget_hide(main_vbox);

/* be sure we don't lose a widget while rearranging */gtk_widget_ref(menubar);

gtk_widget_ref(main_tb);

gtk_widget_ref(filter_tb);

#ifdef

HAVE_AIRPCAPgtk_widget_ref(airpcap_tb);

#endif

gtk_widget_ref(pkt_scrollw);

gtk_widget_ref(tv_scrollw);

gtk_widget_ref(MyPane);

gtk_widget_ref(byte_nb_ptr);

gtk_widget_ref(statusbar);

gtk_widget_ref(main_pane_v1);

gtk_widget_ref(main_pane_v2);

gtk_widget_ref(main_pane_h1);

gtk_widget_ref(main_pane_h2);

gtk_widget_ref(welcome_pane);

/* empty all containers participating */gtk_container_foreach(GTK_CONTAINER(main_vbox), foreach_remove_a_child, main_vbox);

gtk_container_foreach(GTK_CONTAINER(main_pane_v1), foreach_remove_a_child, main_pane_v1);

gtk_container_foreach(GTK_CONTAINER(main_pane_v2), foreach_remove_a_child, main_pane_v2);

gtk_container_foreach(GTK_CONTAINER(main_pane_h1), foreach_remove_a_child, main_pane_h1);

gtk_container_foreach(GTK_CONTAINER(main_pane_h2), foreach_remove_a_child, main_pane_h2);

statusbar_widgets_emptying(statusbar);

/* add the menubar always at the top */gtk_box_pack_start(GTK_BOX(main_vbox), menubar, FALSE, TRUE, 0);

/* main toolbar */gtk_box_pack_start(GTK_BOX(main_vbox), main_tb, FALSE, TRUE, 0);

/* filter toolbar in toolbar area */

if (!prefs.filter_toolbar_show_in_statusbar) {gtk_box_pack_start(GTK_BOX(main_vbox), filter_tb, FALSE, TRUE, 1);

}

#ifdef

HAVE_AIRPCAP

/* airpcap toolbar */gtk_box_pack_start(GTK_BOX(main_vbox), airpcap_tb, FALSE, TRUE, 1);

#endif

/* fill the main layout panes */

switch(prefs.gui_layout_type) {

case(layout_type_5):main_first_pane = main_pane_v1;

main_second_pane = main_pane_v2;

split_top_left = FALSE;

break;

case(layout_type_2):main_first_pane = main_pane_v1;

main_second_pane = main_pane_h1;

split_top_left = FALSE;

break;

case(layout_type_1):main_first_pane = main_pane_v1;

main_second_pane = main_pane_h1;

split_top_left = TRUE;

break;

case(layout_type_4):main_first_pane = main_pane_h1;

main_second_pane = main_pane_v1;

split_top_left = FALSE;

break;

case(layout_type_3):main_first_pane = main_pane_h1;

main_second_pane = main_pane_v1;

split_top_left = TRUE;

break;

case(layout_type_6):main_first_pane = main_pane_h1;

main_second_pane = main_pane_h2;

split_top_left = FALSE;

break;

default:main_first_pane = NULL;

main_second_pane = NULL;

split_top_left = FALSE;

g_assert_not_reached();

}

MyPane = welcome_new();

//MyPane = gtk_vpaned_new();

//gtk_widget_show(MyPane);MyPane = gtk_hpaned_new();

MyPane = welcome_new();

gtk_widget_show(MyPane);

gtk_paned_pack1(GTK_PANED(main_second_pane), MyPane, TRUE,TRUE);

if

(split_top_left) { first_pane_widget1 = main_second_pane;

second_pane_widget1 = main_widget_layout(prefs.gui_layout_content_1);

second_pane_widget2 = main_widget_layout(prefs.gui_layout_content_2);

first_pane_widget2 = main_widget_layout(prefs.gui_layout_content_3);

}

else {

first_pane_widget1 = main_widget_layout(prefs.gui_layout_content_1);

first_pane_widget2 = main_second_pane;

second_pane_widget1 = main_widget_layout(prefs.gui_layout_content_2);

second_pane_widget2 = main_widget_layout(prefs.gui_layout_content_3);

}

if (first_pane_widget1 != NULL)gtk_paned_add1(GTK_PANED(main_first_pane), first_pane_widget1);

if (first_pane_widget2 != NULL)gtk_paned_add2(GTK_PANED(main_first_pane), first_pane_widget2);

if (second_pane_widget1 != NULL)gtk_paned_pack1(GTK_PANED(main_second_pane), second_pane_widget1, TRUE, TRUE);

if (second_pane_widget2 != NULL)gtk_paned_pack2(GTK_PANED(main_second_pane), second_pane_widget2, FALSE, FALSE);

gtk_container_add(GTK_CONTAINER(main_vbox), main_first_pane);

/* welcome pane */gtk_box_pack_start(GTK_BOX(main_vbox), welcome_pane, TRUE, TRUE, 0);

//gtk_box_pack_start(GTK_BOX(main_vbox), MyPane, TRUE, TRUE, 0);

/* statusbar */gtk_box_pack_start(GTK_BOX(main_vbox), statusbar, FALSE, TRUE, 0);

/* filter toolbar in statusbar hbox */

if (prefs.filter_toolbar_show_in_statusbar) {gtk_box_pack_start(GTK_BOX(statusbar), filter_tb, FALSE, TRUE, 1);

}

#ifdef

HAVE_AIRPCAP

/* airpcap toolbar */gtk_box_pack_start(GTK_BOX(main_vbox), airpcap_tb, FALSE, TRUE, 1);

#endif

/* statusbar widgets */statusbar_widgets_pack(statusbar);

/* hide widgets on users recent settings */main_widgets_show_or_hide();

gtk_widget_show(main_vbox);

}

static

voidis_widget_visible(GtkWidget *widget, gpointer data)

{

gboolean *is_visible = data;

if (!*is_visible) {

if (GTK_WIDGET_VISIBLE(widget))*is_visible = TRUE;

}
}

Merci pour votre aide

1 réponse

Messages postés
7
Date d'inscription
vendredi 8 décembre 2000
Statut
Membre
Dernière intervention
21 avril 2009

C'est bon j'ai trouvé mon erreur, j'implémentais pas mon widget dans le bon container.


Si quelqu'un veut des précision qu'il n'hesite pas !!