wrproject Posted November 22, 2007 at 01:59 PM Report Share #149369 Posted November 22, 2007 at 01:59 PM ola pessoal, eu tenho um problema neste codigo, ele nao muda a cor de fundo, nem posiciona os controlos de texto, podiam ajudar-me? #include "wx/wx.h" class teste: public wxApp { wxFrame *janela; wxTextCtrl *texto; bool OnInit() { //definicoes da janela wxSize tamanho_janela(400,200); wxString titulo("janela de teste"); long estilo_janela= wxCAPTION | wxCLOSE_BOX | wxSYSTEM_MENU; janela=new wxFrame(NULL, -1, titulo, wxDefaultPosition, tamanho_janela, estilo_janela); wxColour fundo(48, 214, 100); janela->SetBackgroundColour(fundo); janela->ClearBackground(); //definicoes controlos de texto wxSize tamanho_texto(60,25); wxPoint posicao_texto(20,400); texto = new wxTextCtrl(janela, -1, "", posicao_texto,tamanho_texto); *texto<<"ola eliseu como estas"; janela->Show(true); return true; } int OnExit() { janela->Destroy(); return 0; } void OnChange(wxCommandEvent& event) { *texto<<"ola eliseu"; } DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(teste, wxApp) EVT_TEXT(1, teste::OnChange) END_EVENT_TABLE() //Iniciar a aplicacao IMPLEMENT_APP(teste) cumps 😛 Link to comment Share on other sites More sharing options...
FABIO_F_A_SANTOS Posted November 27, 2007 at 08:30 PM Report Share #150779 Posted November 27, 2007 at 08:30 PM Olá! Olha, agora não tenho muito tempo e por isso não posso analisar o teu código, mas se queres uma sugestão, não tenha trabalho a fazer janelas e outros elemento GUI à mão, usa um dos editores referidos neste tópico que poupas muito tempo e muitas chatices. Aconselho-te o wxDevC++. Cumprimentos! A solução de um problema, por mais complicado que seja, tem de ser simples e clara. Caso contrário criamos um novo problema!O caminho mais fácil é muitas vezes o melhor caminho! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now