flatnotebook
BlitzMax Forums/Brucey's Modules/flatnotebook
| ||
I'm trying to get the text of a page as it's being closed, however using this:Function OnPageClosing(event:wxEvent) Local fnb:wxFlatNotebook = mainFrame.book Notify fnb.GetPageText(fnb.GetPageIndex(fnb.GetCurrentPage())) End Function I get a number from the notify command, why? EDIT: is there a simpler way to get the text of a tab on a flatnotebook? |
| ||
If you mean Notify as in BRL.System's Notify() then I've found it's best not to mix it with wxMax. Not sure if that's your problem in this case, but use a wxMessageBox(s_text) instead. |
| ||
Most certainly not the problem, still getting numbers. old habits ;) |
| ||
I'd break up that one line and see if GetCurrentPage() is working. What event are you hooking into? Perhaps the page has already closed? |
| ||
If I use the same technique when the page is changed it gives a number again, if I switch to another tab, and back again, the number is different then the first time on that tab. |
| ||
I think it's better to initialise fnb as fnb:wxFlatNotebook = wxFlatNotebook(event.parent) instead of using that global. Assuming the notebook is the source of the event of course. GetPageText(GetSelection()) ? [edit] Actually you should be able to cast the event to a wxFlatNoteBookEvent and then event.GetSelection() Does that make any difference? Not having used wxFlatNotebook, I'm about at the end of my guesses, sorry. |
| ||
event.parent is a wxEvtHandler, and does not seem to convert to a wxFlatNotebook type. (I get "Unhandled Exception:Attempt to access field or method of Null object" any time i try to access something from fnb, using event.parent to wxFlatNotebook) |
| ||
OK, so I just tried it below and am getting a number readout too. If you type something in each page and switch back and forth, you will see the second method works: wxTextCtrl(GetCurrentPage()).GetValue() |
| ||
Your code doesn't seem to run. From what I can see, your just getting the text from the textctrl, I'm trying to get the title of the tab. |
| ||
Oh dear, I'm not doing very well am I? :-) I completely misunderstood you. Strange that the code above doesn't run. Works fine here in Leopard. I just edited it to show *a* way of getting the labels. Cheating, I know. [edit] Hmmm works fine in XP Parallels too... |
| ||
Apologies for not replying sooner. Please update for a fix. SuperStrict isn't completely Super Strict, unfortunately... |
| ||
Thanks Brucey, forgot I had one of the first versions of wxmax. |