nis
unread,Dec 12, 2016, 11:04:53 PM12/12/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to eto-...@googlegroups.com
Hi.
Eto.Forms' MenuBar has some special items.
(ApplicationItems, QuitItem, AboutItem...)
Currently they seem to be located in fixed parent-menu.
(ApplicationItems and QuitItems are placed in "File",
AboutItem is placed in "Help")
I want Eto applications internationalized,
so English words such as "File" or "Help" must also be localized.
But in my case...
## Sample code
Menu = new MenuBar
{
Items =
{
new ButtonMenuItem { Text = "&Expediente", Items = { clickMe } },
},
ApplicationItems =
{
new ButtonMenuItem { Text = "&Preferences..." },
},
QuitItem = quitCommand,
AboutItem = aboutCommand
};
## Result
Windows(WPF) : "File" and "Help" are generated along with "Expediente".
Linux(GTK+3) : Launch failed
## Requirement
I want Eto.Forms allow localized menu items,
maintaining special items' functionalities.
## Exception on linux
$ mono EtoTest03_shown_filemenu.Desktop.exe
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at Eto.GtkSharp.Forms.GtkControl`3[TControl,TWidget,TCallback].AttachEvent (System.String id) <0xb2fb8ae8 + 0x00d7a> in <filename unknown>:0
at Eto.WidgetHandler`1[TWidget].HandleEvent (System.String id, Boolean defaultEvent) <0xb2feda78 + 0x00162> in <filename unknown>:0
at Eto.Widget.HandleEvent (System.String id) <0xb2fb8980 + 0x000a3> in <filename unknown>:0
at Eto.PropertyStore.AddHandlerEvent (System.String key, System.Delegate value) <0xb2fb8848 + 0x000c7> in <filename unknown>:0
at Eto.Forms.Control.add_Shown (System.EventHandler`1 value) <0xb2fb8808 + 0x0002f> in <filename unknown>:0
at EtoTest03_shown_filemenu.MainForm..ctor () <0xb5207550 + 0x0021f> in <filename unknown>:0
at EtoTest03_shown_filemenu.Desktop.Program.Main (System.String[] args) <0xb71aded0 + 0x0005b> in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
at Eto.GtkSharp.Forms.GtkControl`3[TControl,TWidget,TCallback].AttachEvent (System.String id) <0xb2fb8ae8 + 0x00d7a> in <filename unknown>:0
at Eto.WidgetHandler`1[TWidget].HandleEvent (System.String id, Boolean defaultEvent) <0xb2feda78 + 0x00162> in <filename unknown>:0
at Eto.Widget.HandleEvent (System.String id) <0xb2fb8980 + 0x000a3> in <filename unknown>:0
at Eto.PropertyStore.AddHandlerEvent (System.String key, System.Delegate value) <0xb2fb8848 + 0x000c7> in <filename unknown>:0
at Eto.Forms.Control.add_Shown (System.EventHandler`1 value) <0xb2fb8808 + 0x0002f> in <filename unknown>:0
at EtoTest03_shown_filemenu.MainForm..ctor () <0xb5207550 + 0x0021f> in <filename unknown>:0
at EtoTest03_shown_filemenu.Desktop.Program.Main (System.String[] args) <0xb71aded0 + 0x0005b> in <filename unknown>:0