packing problem



  Hello all.
    I am trying to create an app with menubar, optionmenu under it and
statusbar next to the optionmenu, but I am having troubles with packing
the widgets...(besides menubar...it is in place).

Here is the code, can someone please tell me what my mistakes are?

  mfactory = new Gtk_MenuFactory(GTK_MENU_FACTORY_MENU_BAR);
  subfactory = new Gtk_MenuFactory(GTK_MENU_FACTORY_MENU_BAR);
  vstatusbar = new Gtk_Statusbar;
  vmod_chooser = new Gtk_OptionMenu;
  vbox = new Gtk_VBox(false, 0);
  hbox = new Gtk_HBox(false, 0);

  mfactory->add_subfactory(subfactory, "<VMainBar>");
  mfactory->add_entries(VMainBar_menus, VMainBar_menu_count);

  mbar = new Gtk_MenuBar(GTK_MENU_BAR(subfactory->gtkobj()->widget));

  // right justify the "Help" menu
  Gtk_MenuPath *menu_path = mfactory->factory_find("<VMainBar>/Help");
  Gtk_MenuItem *menu_item = (Gtk_MenuItem *)menu_path->widget; //
dangerous cast
  menu_item->right_justify();

  // set the vmod_chooser
  // show the items
  vmod_chooser->set_menu(vmod_chooser_menu);
  vmod_chooser_menu->show();

  anim_item->show();
  model_item->show();
  dynam_item->show();

  // vbox packing
  add(vbox);

  vbox->pack_start(mbar, FALSE, FALSE, 0);
  mbar->show();

  vbox->pack_start(hbox, FALSE, FALSE, 0);

  vbox->pack_start(vmod_chooser, FALSE, FALSE, 2);
  vmod_chooser->show();

  vbox->pack_start(vstatusbar, FALSE, FALSE, 2);
  vstatusbar->show();

  vbox->show();
  hbox->show();



I get optionmenu and statusbar in incorrect position....and i can not
figure out how to fix this.  Also, when i click on the optionmenu, no
menu appears(but cursor does change) and menu only appears when i click
on it the second or third time.

Can someone please tell me what am i doing wrong?

Thank you.
Marsel Osipov



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]