wxGauge size issues on Arm Debian Jessie

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 193
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

wxGauge size issues on Arm Debian Jessie

Post by Parduz »

Question related to Debian Stretch with LXQT for Beaglebone Black, wxWidgets 3.0.3, GTK 3 (? i believe)


I want to get this layout
- - - wxGauges Win.png
- - - wxGauges Win.png (28.76 KiB) Viewed 1496 times
(created with wxCrafter 2.0 on Windows7)

but on my Beaglebone black instead I get this
- - - wxGauges Debian.png
- - - wxGauges Debian.png (2.63 KiB) Viewed 1496 times
and i don't know why... and neither what to do.

This is the relevant code generated by wxCrafter:

Code: Select all

    gridBagSizer1823 = new wxGridBagSizer(2, 1);
    m_panel1825->SetSizer(gridBagSizer1823);
    
    m_lSensAT = new wxStaticText(m_panel1825, wxID_ANY, _("AT"), wxDefaultPosition, wxSize(-1,-1), wxALIGN_CENTRE);
    m_lSensAT->SetBackgroundColour(wxColour(wxT("rgb(0,0,255)")));
    m_lSensAT->SetForegroundColour(wxColour(wxT("rgb(255,255,255)")));
    
    gridBagSizer1823->Add(m_lSensAT, wxGBPosition(0,0), wxGBSpan(1,3), wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
    
    m_lSensCT = new wxStaticText(m_panel1825, wxID_ANY, _("CT"), wxDefaultPosition, wxSize(-1,-1), wxALIGN_CENTRE);
    m_lSensCT->SetBackgroundColour(wxColour(wxT("rgb(0,0,255)")));
    m_lSensCT->SetForegroundColour(wxColour(wxT("rgb(255,255,255)")));
    
    gridBagSizer1823->Add(m_lSensCT, wxGBPosition(0,3), wxGBSpan(1,3), wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
    
    m_lSensBT = new wxStaticText(m_panel1825, wxID_ANY, _("BT"), wxDefaultPosition, wxSize(-1,-1), wxALIGN_CENTRE);
    m_lSensBT->SetBackgroundColour(wxColour(wxT("rgb(0,0,255)")));
    m_lSensBT->SetForegroundColour(wxColour(wxT("rgb(255,255,255)")));
    
    gridBagSizer1823->Add(m_lSensBT, wxGBPosition(0,6), wxGBSpan(1,3), wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
    
    m_lSensDT = new wxStaticText(m_panel1825, wxID_ANY, _("DT"), wxDefaultPosition, wxSize(-1,-1), wxALIGN_CENTRE);
    m_lSensDT->SetBackgroundColour(wxColour(wxT("rgb(0,0,255)")));
    m_lSensDT->SetForegroundColour(wxColour(wxT("rgb(255,255,255)")));
    
    gridBagSizer1823->Add(m_lSensDT, wxGBPosition(0,9), wxGBSpan(1,3), wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
    
    m_lSensET = new wxStaticText(m_panel1825, wxID_ANY, _("ET"), wxDefaultPosition, wxSize(-1,-1), wxALIGN_CENTRE);
    m_lSensET->SetBackgroundColour(wxColour(wxT("rgb(0,0,255)")));
    m_lSensET->SetForegroundColour(wxColour(wxT("rgb(255,255,255)")));
    
    gridBagSizer1823->Add(m_lSensET, wxGBPosition(0,12), wxGBSpan(1,3), wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5);
    
    m_gSensT_A1 = new wxGauge(m_panel1825, wxID_ANY, 255, wxDefaultPosition, wxSize(-1,-1), wxGA_SMOOTH|wxGA_VERTICAL);
    m_gSensT_A1->SetValue(32);
    
    gridBagSizer1823->Add(m_gSensT_A1, wxGBPosition(1,0), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_RIGHT|wxALIGN_TOP, 5);
    m_gSensT_A1->SetMinSize(wxSize(30,-1));
    
    m_gSensT_A2 = new wxGauge(m_panel1825, wxID_ANY, 255, wxDefaultPosition, wxSize(-1,-1), wxGA_SMOOTH|wxGA_VERTICAL);
    m_gSensT_A2->SetValue(32);
    
    gridBagSizer1823->Add(m_gSensT_A2, wxGBPosition(1,2), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
    m_gSensT_A2->SetMinSize(wxSize(30,-1));
    
    m_gSensT_C1 = new wxGauge(m_panel1825, wxID_ANY, 255, wxDefaultPosition, wxSize(-1,-1), wxGA_SMOOTH|wxGA_VERTICAL);
    m_gSensT_C1->SetValue(32);
    
    gridBagSizer1823->Add(m_gSensT_C1, wxGBPosition(1,3), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_RIGHT|wxALIGN_TOP, 5);
    m_gSensT_C1->SetMinSize(wxSize(30,-1));
    
    m_gSensT_C2 = new wxGauge(m_panel1825, wxID_ANY, 255, wxDefaultPosition, wxSize(-1,-1), wxGA_VERTICAL);
    m_gSensT_C2->SetValue(110);
    
    gridBagSizer1823->Add(m_gSensT_C2, wxGBPosition(1,5), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
    m_gSensT_C2->SetMinSize(wxSize(30,-1));
    
    m_gSensT_B1 = new wxGauge(m_panel1825, wxID_ANY, 255, wxDefaultPosition, wxSize(-1,-1), wxGA_VERTICAL);
    m_gSensT_B1->SetValue(110);
    
    gridBagSizer1823->Add(m_gSensT_B1, wxGBPosition(1,6), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_RIGHT|wxALIGN_TOP, 5);
    m_gSensT_B1->SetMinSize(wxSize(30,-1));
    
    m_gSensT_B2 = new wxGauge(m_panel1825, wxID_ANY, 255, wxDefaultPosition, wxSize(-1,-1), wxGA_VERTICAL);
    m_gSensT_B2->SetValue(110);
    
    gridBagSizer1823->Add(m_gSensT_B2, wxGBPosition(1,8), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
    m_gSensT_B2->SetMinSize(wxSize(30,-1));
    
    m_gSensT_D1 = new wxGauge(m_panel1825, wxID_ANY, 255, wxDefaultPosition, wxSize(-1,-1), wxGA_VERTICAL);
    m_gSensT_D1->SetValue(110);
    
    gridBagSizer1823->Add(m_gSensT_D1, wxGBPosition(1,9), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_RIGHT|wxALIGN_TOP, 5);
    m_gSensT_D1->SetMinSize(wxSize(30,-1));
    
    m_gSensT_D2 = new wxGauge(m_panel1825, wxID_ANY, 255, wxDefaultPosition, wxSize(-1,-1), wxGA_VERTICAL);
    m_gSensT_D2->SetValue(110);
    
    gridBagSizer1823->Add(m_gSensT_D2, wxGBPosition(1,11), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
    m_gSensT_D2->SetMinSize(wxSize(30,-1));
    
    m_gSensT_E1 = new wxGauge(m_panel1825, wxID_ANY, 255, wxDefaultPosition, wxSize(-1,-1), wxGA_VERTICAL);
    m_gSensT_E1->SetValue(110);
    
    gridBagSizer1823->Add(m_gSensT_E1, wxGBPosition(1,12), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_RIGHT|wxALIGN_TOP, 5);
    m_gSensT_E1->SetMinSize(wxSize(30,-1));
    
    m_gSensT_E2 = new wxGauge(m_panel1825, wxID_ANY, 255, wxDefaultPosition, wxSize(-1,-1), wxGA_VERTICAL);
    m_gSensT_E2->SetValue(110);
    
    gridBagSizer1823->Add(m_gSensT_E2, wxGBPosition(1,14), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 5);
    m_gSensT_E2->SetMinSize(wxSize(30,-1));
    gridBagSizer1823->AddGrowableRow(1);

How could i align the gauges, and set the width i need?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7480
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxGauge size issues on Arm Debian Jessie

Post by ONEEYEMAN »

Hi,
What is the GTK+ version you use in both cases? Are they the same?
Can you try the simple application with the wxBoxSizer? Will it work correctly?

Thank you.
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 193
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: wxGauge size issues on Arm Debian Jessie

Post by Parduz »

ONEEYEMAN wrote:What is the GTK+ version you use in both cases? Are they the same?
I don't think so: the fist one is a screenshot of the Windows7 preview in wxCrafter :?: (well, the compiled exe looks the same)
The second one is my app running on the BBB.
Here's what i have on the Beaglebone:

Code: Select all

root@beaglebone:/home/debian/MSXPG# dpkg -l libgtk2.0-0 libgtk-3-0
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                               Version        Architecture    Description
+++-==================================-==============-===============-=================
ii  libgtk-3-0:armhf                   3.22.11-1      armhf           GTK+ graphical user interface library
ii  libgtk2.0-0:armhf                  2.24.31-2      armhf           GTK+ graphical user interface library
root@beaglebone:/home/debian/MSXPG#
About what it uses, i don't know.
Is the config.log somewhat useful?
https://pastebin.com/8BTUFz0G
ONEEYEMAN wrote: Can you try the simple application with the wxBoxSizer? Will it work correctly?
What it should be?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7480
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxGauge size issues on Arm Debian Jessie

Post by ONEEYEMAN »

Hi,
Do you have GTK development package installed? Something like gtk-devel for the BBB.
I saw a configure test failed because it couldn't find the gtk header.

Sorry don't know what its called on Debian. I don't use this distro.

If you don't - after you install you will have to re-configure/-compile wx and your software.

BTW, you should be able to compile and run the widgets sample.

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19161
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxGauge size issues on Arm Debian Jessie

Post by doublemax »

I guess wxGauges are not really designed to scale in two directions. Even the Windows one looks "wrong", and the GTK gauge is probably the "standard" gauge for that theme and won't scale at all in the "non-main" direction.

You either have to live with it or build your own gauge control, which should be pretty simple.
Use the source, Luke!
Post Reply