[Gtk-sharp-list] Question about Status bar and Menu bar

Antonio Gutiérrez Mayoral agutierr@gsyc.escet.urjc.es
Sat, 20 Nov 2004 01:59:46 +0100


I have do it!. This is the easy form (in my opinion):

1) In glade, define names for each menu entry: MenuItemXXXX
2) In .cs code, instanciate .glade file and autoconnect.
3) Add handlers for 'Selected' and 'Deselected' events on each menu item
(first remember to declare [Widget] Gtk.MenuItem MenuItemXXXX)
MenuItemXXXX.Selected += new EventHandler(.....);
4) On these handlers, write on status bar (selected) or clear the status
bar (deselected).

It's works fine!!!

Thanks all.

El vie, 19-11-2004 a las 10:37 -0600, Sergio Duran escribió:
> I'm still learning gtk# and C# so I dont know if this is the best method.=
..
> 
> I make no guarantees, I'm still learning :)
> 
> class test {
>   Menu menu;
>   MenuItem item;
>   Statusbar status;
>   Label label;
> 
>   static void Main() {
>     new test();
>   }
>   public test() {
>     .. create window ...
>     label = new Label("status bar label");
>     status.Add(label);
>     menu = new Menu();
>     item = new MenuItem("Item1");
>     item.Activated += new EventHandler(ItemActivated);
>     menu.Add(item);
>     ..  add menu and statusbar to window ...
>   }
>   void ItemActivated(object o, EventArgs args) {
>     label.Text="an item was clicked";
>   }
> }
> 
> 
> On Fri, 19 Nov 2004 17:19:38 +0100, Antonio Gutiérrez Mayoral
> <agutierr@gsyc.escet.urjc.es> wrote:
> > Hi list,
> > 
> > I have a question about Status bar widget and the menu bar. I have my
> > app where I have a Menu bar, with Menu entrys, and I have the status ba=
r
> > where I would like to write messages about the entrys on Menu. When the
> > user select a menu entry, I would like to write a message on the status
> > bar. But, I dont know what event is asociated to put mouse over a menu
> > entry.
> > 
> > Help!! Thanks.
> > --
> > Antonio Gutiérrez Mayoral
> > Escuela Superior de CC Experimentales y Tecnología
> > Universidad Rey Juan Carlos
> > web: http://gsyc.escet.urjc.es/~agutierr
> > _______________________________________________
> > Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> >
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
-- 
Antonio Gutiérrez Mayoral
Escuela Superior de CC Experimentales y Tecnología
Universidad Rey Juan Carlos
web: http://gsyc.escet.urjc.es/~agutierr