Thread: Image buttons

    #1
  1. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407

    Image buttons


    Im working with wxBitmapButton but for some reason the image shows but not as a button ( working under linux ) does anyone knows why?

    Code:
    wxInitAllImageHandlers( )
                                                                                                   
    img = wxImage('cd.png', wxBITMAP_TYPE_PNG).ConvertToBitmap( )
                                                                                                   
    w   = img.GetWidth( )
    h   = img.GetHeight( )
                                                                                                   
    bnt = wxBitmapButton(self, -1, img, (20, 20), (w, h))
                                                                                                   
    EVT_BUTTON(self, BUTTON_ID, self.OnClick )
    I even looked at the demo version that comes witht he demo package but i got alot of errrors.. but i have seen other examples.. and they seem to be the same as what i have on top.. so im kinda confused abit
    Last edited by xlordt; July 3rd, 2004 at 11:47 PM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Location
    Bimingham,AL
    Posts
    68
    Rep Power
    11
    why don't you try using wxbitmap for creating an image
    wxBitmapFromImage(image, depth=-1)
    this worked fine for me
  4. #3
  5. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407
    ya forgot to mention that i got it working.. but i still would like to see an example of the way you do it for future use

IMN logo majestic logo threadwatch logo seochat tools logo