[Gtk-sharp-list] OptionMenu behaviour

David Makovský (Yakeen) yakeen@sannyas-on.net
Mon, 01 Dec 2003 15:01:21 +0100


--=-NGBb7bjl6V8apvMUTpbZ
Content-Type: multipart/alternative; boundary="=-SsidjMh7YzCwh06n5I0Q"


--=-SsidjMh7YzCwh06n5I0Q
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi all,
I have some strange behaviour with OptionMenu..
I want to implement printer chooser for proprietary software...
There are definned objects of printers....

...

[Glade.Widget] Gtk.OptionMenu printers_optionmenu;
ArrayList printers;
Gtk.Menu printers_menu

...

printers_menu =3D new Menu();
		=09
IEnumerator printersEnum =3D printers.GetEnumerator();
  		=09
while ( printersEnum.MoveNext() ) {
	Printer printer =3D new Printer((uint)printersEnum.Current);
	MenuItem item =3D MenuItem.NewWithLabel(printer.Name);
	item.Activated +=3D new EventHandler (item_callback);
	printers_menu.Append (item);
}
		=09
printers_optionmenu.Menu =3D left_menu;

...

private void item_callback (object obj, EventArgs args) { //it's empty for =
now
}


And after start (showing) there is choosed first one in option menu,
thats correct.
But when I click on it I'm getting empty list (menu).

Do you someone know what I'm doing wrong?
I need two printers selectors left and right together (thats for
industrial solution)
How I can find out that Is selected right this one?
Can someone point out how?

Thanks
--=20
David Makovsk=C3=BD (Yakeen) <yakeen@sannyas-on.net>

--=-SsidjMh7YzCwh06n5I0Q
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8">
  <META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.0.9">
</HEAD>
<BODY>
Hi all,<BR>
I have some strange behaviour with OptionMenu..<BR>
I want to implement printer chooser for proprietary software...<BR>
There are definned objects of printers....<BR>
<BR>
...
<PRE>[Glade.Widget] Gtk.OptionMenu printers_optionmenu;
ArrayList printers;
Gtk.Menu printers_menu</PRE>
...
<PRE>printers_menu =3D new Menu();
		=09
IEnumerator printersEnum =3D printers.GetEnumerator();
&nbsp; 		=09
while ( printersEnum.MoveNext() ) {
	Printer printer =3D new Printer((uint)printersEnum.Current);
	MenuItem item =3D MenuItem.NewWithLabel(printer.Name);
	item.Activated +=3D new EventHandler (item_callback);
	printers_menu.Append (item);
}
		=09
printers_optionmenu.Menu =3D left_menu;</PRE>
...
<PRE>private void item_callback (object obj, EventArgs args) { //it's empty=
 for now
}</PRE>
<BR>
And after start (showing) there is choosed first one in option menu, thats =
correct.<BR>
But when I click on it I'm getting empty list (menu).<BR>
<BR>
Do you someone know what I'm doing wrong?<BR>
I need two printers selectors left and right together (thats for industrial=
 solution)<BR>
How I can find out that Is selected right this one?<BR>
Can someone point out how?<BR>
<BR>
Thanks<BR>
<TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%">
<TR>
<TD>
-- <BR>
David Makovsk&#253; (Yakeen) &lt;<A HREF=3D"mailto:yakeen@sannyas-on.net"><=
U>yakeen@sannyas-on.net</U></A>&gt;
</TD>
</TR>
</TABLE>

</BODY>
</HTML>

--=-SsidjMh7YzCwh06n5I0Q--

--=-NGBb7bjl6V8apvMUTpbZ
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Toto je =?iso-8859-2?Q?digit=E1ln=EC?=
	=?ISO-8859-1?Q?_podepsan=E1?= =?iso-8859-2?Q?_=E8=E1st?=
	=?ISO-8859-1?Q?_zpr=E1vy?=

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQA/y0mxoAbJtReBEbQRAuFQAJ0dYC7M/s1UQbQNtt8pVEJXQylTIACdE7pv
2kRAhdZ/XWJ+tiDd1shCE+A=
=RZuU
-----END PGP SIGNATURE-----

--=-NGBb7bjl6V8apvMUTpbZ--