08-30-2023, 07:06 AM
Hi, I'm using nuget with C# console. I have setup like the example:
And in my Program of Console app:
The toolbar shows at the top-left corner of screen, but when hover on the button, tooltip does not show.
Any idea for this?
My appreciate.
public class ToolbarRunner
{
[AttributeUsage(AttributeTargets.Method)] class TriggersAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)] class ToolbarsAttribute : Attribute { }
ActionTriggers Triggers { get; } = new();
public void Run()
{
RunTriggersAndToolbars();
}
void RunTriggersAndToolbars()
{
void _TriggerOptions(bool toolbars)
{
}
foreach (var mi in typeof(ToolbarRunner).GetMethods(BindingFlags.DeclaredOnly | BindingFlags.NonPublic | BindingFlags.Instance))
{
bool tb = mi.IsDefined(typeof(ToolbarsAttribute), false);
if (!(tb || mi.IsDefined(typeof(TriggersAttribute), false))) continue;
Triggers.ResetOptions();
_TriggerOptions(toolbars: tb);
if (tb) Triggers.Options.ThreadThis();
try { mi.Invoke(this, null); }
catch (TargetInvocationException ex) { print.it(ex.InnerException); return; }
}
//run triggers in other thread, to avoid blocking hooks when getting icons etc
Triggers.RunThread();
}
[Toolbars]
void Toolbar_Floating_Triggers()
{
Toolbar_Floating();
}
void Toolbar_Floating()
{
var t = new toolbar();
if (t.FirstTime)
{
}
t["Example|EEEEEEEEE"] = o => { print.it("button clicked"); };
t["Text\a"] = o => { }; //this button always displays text. The above button never.
t.Menu("Menu1", t =>
{
t["A"] = o => { };
t["B|Tooltip3"] = o => { };
});
t.Separator();
t["Text2\a|Tooltip2"] = o => { };
t.Show();
}
}
The toolbar shows at the top-left corner of screen, but when hover on the button, tooltip does not show.
Any idea for this?
My appreciate.