45 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
46 gtk_window_set_title (GTK_WINDOW (
window),
"ns-3 Default attributes.");
47 gtk_window_set_default_size (GTK_WINDOW (
window), 600, 600);
50 GtkTreeStore *model = gtk_tree_store_new (
COL_LAST, G_TYPE_POINTER);
52 creator.
Build (model);
55 scroll = gtk_scrolled_window_new (0, 0);
56 gtk_container_add (GTK_CONTAINER (scroll), view);
58 GtkWidget *vbox = gtk_vbox_new (FALSE, 5);
59 gtk_box_pack_start (GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
60 gtk_box_pack_end (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
61 GtkWidget *hbox = gtk_hbox_new (FALSE, 5);
62 gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
63 GtkWidget *save = gtk_button_new_with_label (
"Save");
65 gtk_box_pack_end (GTK_BOX (hbox), save, FALSE, FALSE, 0);
66 GtkWidget *load = gtk_button_new_with_label (
"Load");
68 gtk_box_pack_end (GTK_BOX (hbox), load, FALSE, FALSE, 0);
69 GtkWidget *exit = gtk_button_new_with_label (
"Run Simulation");
71 gtk_box_pack_end (GTK_BOX (hbox), exit, FALSE, FALSE, 0);
73 gtk_container_add (GTK_CONTAINER (
window), vbox);
75 gtk_widget_show_all (
window);
79 gtk_tree_model_foreach (GTK_TREE_MODEL (model),
83 gtk_widget_destroy (
window);
95 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
96 gtk_window_set_title (GTK_WINDOW (
window),
"ns-3 Object attributes.");
97 gtk_window_set_default_size (GTK_WINDOW (
window), 600, 600);
102 GtkTreeStore *model = gtk_tree_store_new (
COL_LAST, G_TYPE_POINTER);
104 creator.
Build (model);
107 scroll = gtk_scrolled_window_new (0, 0);
108 gtk_container_add (GTK_CONTAINER (scroll), view);
110 GtkWidget *vbox = gtk_vbox_new (FALSE, 5);
111 gtk_box_pack_start (GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
112 gtk_box_pack_end (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
113 GtkWidget *hbox = gtk_hbox_new (FALSE, 5);
114 gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
115 GtkWidget *save = gtk_button_new_with_label (
"Save");
117 gtk_box_pack_end (GTK_BOX (hbox), save, FALSE, FALSE, 0);
118 GtkWidget *load = gtk_button_new_with_label (
"Load");
120 gtk_box_pack_end (GTK_BOX (hbox), load, FALSE, FALSE, 0);
121 GtkWidget *exit = gtk_button_new_with_label (
"Run Simulation");
123 gtk_box_pack_end (GTK_BOX (hbox), exit, FALSE, FALSE, 0);
125 gtk_container_add (GTK_CONTAINER (
window), vbox);
127 gtk_widget_show_all (
window);
131 gtk_tree_model_foreach (GTK_TREE_MODEL (model),
135 gtk_widget_destroy (
window);
void ConfigureAttributes(void)
Process attribute values.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void Build(GtkTreeStore *treestore)
This method will iterate on typeIds having default attributes and create a model for them...
void Build(GtkTreeStore *treestore)
Allocate attribute tree.
void ConfigureDefaults(void)
Process default values.
void load_clicked(GtkButton *button, gpointer user_data)
If the user presses the button load, it will load the config file into memory.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
GtkWidget * create_view_config_default(GtkTreeStore *model)
This is the main view opening the widget, getting tooltips and drawing the tree of attributes...
GtkWidget * create_view(GtkTreeStore *model)
This is the main view opening the widget, getting tooltips and drawing the tree of attributes...
ModelTypeIdCreator class.
void load_clicked_default(GtkButton *button, gpointer user_data)
If the user presses the button load, it will load the config file into memory.
void exit_clicked_callback(GtkButton *button, gpointer user_data)
Exit the window when exit button is pressed.
gboolean clean_model_callback(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
Delete the tree model contents.
gboolean clean_model_callback_config_default(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
Delete the tree model contents.
void save_clicked_default(GtkButton *button, gpointer user_data)
This is the action done when the user presses on the save button.
gboolean delete_event_callback(GtkWidget *widget, GdkEvent *event, gpointer user_data)
Exit the application.
void save_clicked(GtkButton *button, gpointer user_data)
This is the action done when the user presses on the save button.