How to change the background image of a Wxdialog?

Asked

Viewed 170 times

3

How do I use an image like background of a wxDialog? Using the WxStaticBitmap, components do not appear right. I am using version 2.8.12 of Wxwidgets.

Example of expected result:

imagem

  • What is the problem you see in the components ? seems normal to me.

  • wxButton is not displayed correctly. The button is rectangular when it has rounded edges...

  • See if this solves: button->Setbackgroundstyle(wxBG_STYLE_TRANSPARENT)

  • It would work, but I’m on version 2.8.12, which doesn’t have wxBG_STYLE_TRANSPARENT yet.

  • and so ? button->Setbackgroundstyle(wxBG_STYLE_CUSTOM)

  • Stay the same way.

  • in which SO vc is working and pq use version 2.8 ?

  • Windows 7, because I only found wxLua for 2.8.12, and I use Lua.

Show 3 more comments

1 answer

1

It doesn’t. This version of wxWidgets you’re using is pretty old. As far as I know, all development is focused on 3.0+ versions. This version 2.8 you are using will no longer receive improvements. They were made in the most recent versions. If the Lua language you are using is still using this version and you have no other option, the way is to adapt to it. Like using a background image that has colors that suit Buttons. Especially pq this function you want is only available in Gtk (Gnome environment for GNU/Linux). As you can read here:

http://docs.wxwidgets.org/2.8.12/wx_wxwindow.html#wxwindowsetbackgroundstyle

"On GTK+, use of wxBG_STYLE_CUSTOM Allows the Flicker-free Drawing of a custom background, such as a Tiled bitmap. Currently the style has in Effect on other Platforms."

Translation: "In GTK+, the use of wxBG_STYLE_CUSTOM allows the drawing of a custom background, like a tiled bitmap. Currently the style does not has an effect on other platforms."

  • 1

    Changing the background image is a good idea also because it’s a joke to use a picture of penguins as a background image of a Windows application :D KKK

Browser other questions tagged

You are not signed in. Login or sign up in order to post.