CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2009
    Posts
    24

    GTK/wxWidgets bug gui problem

    Thanks in advance for reading this. I am using Ubuntu Linux 10.4 LTS, wxWidgets 2.8, and Gtk 2.* (I'm not sure which version, theire are too many packages)

    Whenever I run my program no icons are shown. This is a big problem because I need buttons. When I run the program in the terminal here is the output...

    Code:
    emmanuel@emmanuel-laptop:~/Desktop/c++/wxwdgts/mine$ ./main
    
    (main:9619): Gdk-CRITICAL **: gdk_drawable_get_size: assertion `GDK_IS_DRAWABLE (drawable)' failed
    
    (main:9619): Gdk-CRITICAL **: gdk_drawable_get_depth: assertion `GDK_IS_DRAWABLE (drawable)' failed
    And here is the program I compiled.
    Code:
    #include<wx/wx.h>
    #include<wx/toolbar.h>
    #include<wx/bitmap.h>
    
    class MyFrame : public wxFrame
      {
      public:
        MyFrame(wxString name);
        void OnQuit(wxCommandEvent& event);
      };
    
    MyFrame::MyFrame(wxString name) : wxFrame(NULL, wxID_ANY, name, wxDefaultPosition, wxSize(300,300))
      { 
        wxBitmap exit(wxT("exit.png"));
        wxToolBar *mtool = CreateToolBar();
        mtool->AddTool((int)wxID_EXIT, exit, wxT("Exit app"));
        mtool->Realize();
        Connect(wxID_EXIT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MyFrame::OnQuit));
      }
      
    void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
      { 
        Close(true);
      }
      
    class MyApp : public wxApp
      {
      public:
        virtual bool OnInit();
      };
    
    IMPLEMENT_APP(MyApp)
    
    bool MyApp::OnInit()
      { 
        MyFrame *main=new MyFrame(wxT("Submenu"));
        main->Show(true);
        return true;
      }

  2. #2
    Join Date
    Jan 2009
    Posts
    24

    Re: GTK/wxWidgets bug gui problem

    This was solved in the wxWidgets forums see http://wxforum.shadonet.com/viewtopic.php?p=122802.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured