Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Newbie Problems with the menu example...
Newbie Problems with the menu example... [message #3515] |
Tue, 30 May 2006 19:12 |
_Seven_
Messages: 35 Registered: April 2006
|
Member |
|
|
Hi everyone. I am trying follow an example posted on site of U++ and i tried to create the same program but it's not work. I don't know where is the problem. Can you help me? Where i am wrong?
The code:
#include <CtrlLib/CtrlLib.h>
struct App : public TopWindow{
bool list_numbers;
void Exit(){
Close();
}
void List_Numbers(){
list_numbers=!list_numbers;
}
void show(int i){
PromptOK(AsString(i));
}
void draw(Bar& bar){
for(int i=0;i<10;i++)
bar.Add(AsString(i), THISBACK(show,i));
}
void Opcoes(Bar& bar){
bar.Add("Mostrar numeros", THISBACK(List_Numbers));
bar.Add("Lista :", THISBACK(draw));
bar.Add("Sair", THISBACK(Exit)).Key(CTRL_Q);
}
void MenuBar(Bar& bar){
bar.Add("Opcoes",THISBACK(Opcoes));
}
MainBar Opcoes;
typedef App CLASSNAME;
App(){
numbers_enabled = true;
AddFrame(Opcoes);
menu.Set(THISBACK(MainBar));
}
};
GUI_APP_MAIN
{
App.Run();
}
[Updated on: Wed, 31 May 2006 16:47] by Moderator Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon May 13 13:53:35 CEST 2024
Total time taken to generate the page: 0.03252 seconds
|