Frage

I thought it will be easy, but...

// An empty Notebook defined in Stetic designer and created in generated code
Notebook tabs = this.TabsContainer;

tabs.SelectPage += (o, args) => {
    Application.Quit();
};

// Then I add some pages in code by calling tabs.AppendPage(...)

With this code, when I switch Notebook pages back and forth by clicking at tabs, event is obviously not handled. I tried also using other event (FocusTab), but handler is never called anyway. What have I missed?

War es hilfreich?

Lösung

I looked at the sources of gtk+ and it seems that the select-page signal is defined, but is never emitted (I will probably file a bug to mark it as deprecated).

I also noticed that the signal switch-page (which you should be able to subscribe via the event SwitchPage) is certainly emitted, so this should work (please report back if it doesn't and I'll take another look).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top