Home » U++ Library support » TabCtrl » trouble with tabs ((identifying selected tab))
Re: trouble with tabs [message #52470 is a reply to message #52462] |
Fri, 04 October 2019 00:04   |
|
Hi Koldo-
I outlined 2 examples to illustrate my confusion.
I hope you can now see what I am doing wrong.
Example 1:
int func(int a) {
// cout << "Hello" << a << '\n';
return 2;
}
struct CantonEdu : public WithRooLayout<TopWindow> {
WithQueryLayout<TopWindow> query;
class functions..
class members...
void CantonEdu::ManageMenus(int n);
Button b1;
TabCtrl tab1 // defined in layout
int func(int a);
typedef CantonEdu CLASSNAME;
};
int (& r_ref)(int) = func;
Add ( b1.LeftPos ( 10, 100 ).BottomPos ( 10, 30 ) );
b1.SetLabel ( "Click me!" );
b1 <<= THISBACK ( r_ref, 1 ) ; /** thisback and r_ref not agreeing in this scope (GUI) **/
b1 and r_ref not in same scope.
Example 2:
tab1.WhenSet = [&] {
int n = tab1.Get(); // compiles
ManageMenus(n); // compiles
};
void CantonEdu::ManageMenus(int n) {
PromptOK( " " + n): // (blank PromptOk - empty value)
}
n does not equal index of recently clicked tab
I'd like to be able thisback to call function with these parameters as well: void ManageMenus (TabCTRL tab1, MenuBar menu).
tab1.WhenSet =THISBACK(ManageMenus,tab1, menu);
NOTE: I mean to indicate a function reference that points to function like:
void func (CtrlTab tab, MenuBar menu) ;
void (& func_ref)(CtrlTab, MenuBar) = func;
tab1.WhenSet = THISBACK(func_ref, tab1, menu);
I hope that is a little more clear.
I don't know if these examples are easy to follow and/or easy to implement.
Thnx for any assistance.
roboloki
[Updated on: Fri, 04 October 2019 12:00] by Moderator Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Jul 06 22:39:11 CEST 2025
Total time taken to generate the page: 0.03350 seconds
|