add more widgets to the main window
This commit is contained in:
parent
b06efd107d
commit
a5f083c199
1 changed files with 33 additions and 8 deletions
|
@ -23,7 +23,6 @@ gboolean on_mainwindow_delete_event(GtkWidget *w, GdkEvent *e, gpointer d);
|
||||||
void on_quit_activate(GtkMenuItem *item, gpointer d);
|
void on_quit_activate(GtkMenuItem *item, gpointer d);
|
||||||
void on_applybutton_clicked(GtkButton *but, gpointer d);
|
void on_applybutton_clicked(GtkButton *but, gpointer d);
|
||||||
void on_revertbutton_clicked(GtkButton *but, gpointer d);
|
void on_revertbutton_clicked(GtkButton *but, gpointer d);
|
||||||
void on_helpbutton_clicked(GtkButton *but, gpointer d);
|
|
||||||
void on_selection_changed(GtkTreeSelection *selection, gpointer data);
|
void on_selection_changed(GtkTreeSelection *selection, gpointer data);
|
||||||
|
|
||||||
static void obconf_error(GError *e)
|
static void obconf_error(GError *e)
|
||||||
|
@ -141,6 +140,10 @@ int main(int argc, char **argv)
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *hpane;
|
GtkWidget *hpane;
|
||||||
GtkAccelGroup *accel;
|
GtkAccelGroup *accel;
|
||||||
|
GtkWidget *sep;
|
||||||
|
GtkWidget *bbox;
|
||||||
|
GtkWidget *but;
|
||||||
|
GtkWidget *bar;
|
||||||
|
|
||||||
gtk_set_locale();
|
gtk_set_locale();
|
||||||
gtk_init(&argc, &argv);
|
gtk_init(&argc, &argv);
|
||||||
|
@ -156,7 +159,7 @@ int main(int argc, char **argv)
|
||||||
accel = gtk_accel_group_new();
|
accel = gtk_accel_group_new();
|
||||||
gtk_window_add_accel_group(GTK_WINDOW(mainwin), accel);
|
gtk_window_add_accel_group(GTK_WINDOW(mainwin), accel);
|
||||||
|
|
||||||
vbox = gtk_vbox_new(FALSE, 3);
|
vbox = gtk_vbox_new(FALSE, 5);
|
||||||
gtk_container_add(GTK_CONTAINER(mainwin), vbox);
|
gtk_container_add(GTK_CONTAINER(mainwin), vbox);
|
||||||
|
|
||||||
/* Menu */
|
/* Menu */
|
||||||
|
@ -174,9 +177,36 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
/* Main work area */
|
/* Main work area */
|
||||||
|
|
||||||
mainworkarea = gtk_vbox_new(FALSE, 1);
|
mainworkarea = gtk_layout_new(NULL, NULL);
|
||||||
gtk_container_add(GTK_CONTAINER(hpane), mainworkarea);
|
gtk_container_add(GTK_CONTAINER(hpane), mainworkarea);
|
||||||
|
|
||||||
|
/* Separator */
|
||||||
|
|
||||||
|
sep = gtk_hseparator_new();
|
||||||
|
gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
|
||||||
|
|
||||||
|
/* Button box */
|
||||||
|
|
||||||
|
bbox = gtk_hbutton_box_new();
|
||||||
|
gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
|
||||||
|
gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 6);
|
||||||
|
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
|
||||||
|
|
||||||
|
/* Revert Button */
|
||||||
|
|
||||||
|
but = gtk_button_new_with_mnemonic("_Revert");
|
||||||
|
gtk_box_pack_start(GTK_BOX(bbox), but, FALSE, FALSE, 0);
|
||||||
|
|
||||||
|
/* Apply Button */
|
||||||
|
|
||||||
|
but = gtk_button_new_with_mnemonic("_Apply");
|
||||||
|
gtk_box_pack_start(GTK_BOX(bbox), but, FALSE, FALSE, 0);
|
||||||
|
|
||||||
|
/* Status bar */
|
||||||
|
|
||||||
|
bar = gtk_statusbar_new();
|
||||||
|
gtk_box_pack_start(GTK_BOX(vbox), bar, FALSE, FALSE, 0);
|
||||||
|
|
||||||
gtk_widget_show_all(mainwin);
|
gtk_widget_show_all(mainwin);
|
||||||
|
|
||||||
load_stock();
|
load_stock();
|
||||||
|
@ -207,11 +237,6 @@ void on_revertbutton_clicked(GtkButton *but, gpointer d)
|
||||||
g_message("revert");
|
g_message("revert");
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_helpbutton_clicked(GtkButton *but, gpointer d)
|
|
||||||
{
|
|
||||||
g_message("help");
|
|
||||||
}
|
|
||||||
|
|
||||||
void on_selection_changed(GtkTreeSelection *sel, gpointer data)
|
void on_selection_changed(GtkTreeSelection *sel, gpointer data)
|
||||||
{
|
{
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
|
|
Loading…
Reference in a new issue