Discussion:
wxGtk3.0.1: wxButton never shows text with image ..text only
Mahmoud Eltahawy
2014-10-13 16:59:28 UTC
Permalink
Hi All
I am using wxgtk3.0.1 @ redhat6 and wxButton never shows text with image, I
tried to use all API provided to set the
bitmap(SetBitmap, SetBitmapPressed,SetBitmapFocus,SetBitmapCurrent, SetBitmapDisabled)
but no way

Can u please help?

Thanks
Mahmoud
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-10-14 12:15:05 UTC
Permalink
On Mon, 13 Oct 2014 09:59:28 -0700 (PDT) Mahmoud Eltahawy wrote:

ME> I am using wxgtk3.0.1 @ redhat6 and wxButton never shows text with image, I
ME> tried to use all API provided to set the
ME> bitmap(SetBitmap, SetBitmapPressed,SetBitmapFocus,SetBitmapCurrent, SetBitmapDisabled)
ME> but no way

This is due to GTK+ option disabling bitmaps display in the buttons,
you'll easily find more information about it on the web. And as we depend
on GTK+, we can't do anything about this if the images are completely
disabled.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Mahmoud Eltahawy
2014-10-15 11:41:52 UTC
Permalink
Thanks,
I tried to use the function "CreateBitmap" in widgets sample to draw (icon
+ label), but the label is very large w.r.t icon size, so please how can I
make the label smaller ?

wxBitmap ButtonWidgetsPage::CreateBitmap(const wxString& label)
{
wxBitmap bmp(180, 70); // shouldn't hardcode but it's simpler like this
wxMemoryDC dc;
dc.SelectObject(bmp);
dc.SetBackground(*wxCYAN_BRUSH);
dc.Clear();
dc.SetTextForeground(*wxBLACK);
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n")
wxT("(") + label + wxT(" state)"),
wxArtProvider::GetBitmap(wxART_INFORMATION),
wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20),
wxALIGN_CENTRE);

return bmp;
}
Post by Mahmoud Eltahawy
Hi All
I tried to use all API provided to set the
bitmap(SetBitmap, SetBitmapPressed,SetBitmapFocus,SetBitmapCurrent, SetBitmapDisabled)
but no way
Can u please help?
Thanks
Mahmoud
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...