Re: wxEuphoria: sizing of widgets - win vs lnx

new topic     » goto parent     » topic index » view thread      » older message » newer message

Matt Lewis wrote:
> 
> Jerry Story wrote:
> > 
> > What can cause this problem?
> > 
> > The program works perfectly with Linux.
> > But on Windows, same source code, all the widgets are
> > bunched in the upper left corner.
> > 
> > I could use set_size() but I prefer the widgets to size themselves.
> 
> I haven't run into a situation like this.  Could you post a minimal
> example that demonstrates this behavior?
> 
> Matt Lewis

Here it is. On Linux the widgets are okay.  On Windows the widgets are bunched
in the upper left corner.

global constant PROGRAM_TITLE = "Win vs Lnx"



without warning

include wxEuphoria.e

include wxMenu.e

include wxSizer.e

include wxList.e

include wxText.e

include wxButton.e

include wxGraphics.e



global object void



global constant

 frameWin = create(wxFrame,{0,1,PROGRAM_TITLE,-1,-1,900,600}),

 Win = create(wxPanel,{frameWin}),

 boxMain = create(wxBoxSizer,{wxHORIZONTAL})

 set_sizer(Win,boxMain)



global constant

 MenuBar = create(wxMenuBar,{frameWin}),

 FileMenu = create(wxMenu,{MenuBar,"File"}),

   MenuExit = create(wxMenuItem,{FileMenu,wxID_EXIT,"Exit",0}),

 DietMenu = create(wxMenu,{MenuBar,"File"}),

   MenuClearDiet = create(wxMenuItem,{DietMenu,new_id(),"Clear Diet",0}),

 FlavsMenu = create(wxMenu,{MenuBar,"Flavonoids"})



constant

 HRULES = wxLC_REPORT + wxLC_HRULES,



 boxLeft = create(wxBoxSizer,{wxVERTICAL}),

 boxRight = create(wxBoxSizer,{wxVERTICAL})



  add_sizer_to_sizer(boxMain,boxLeft,1,wx_or_all({wxGROW,wxRIGHT}),5)

  add_sizer_to_sizer(boxMain,boxRight,1,wx_or_all({wxGROW,wxLEFT}),5)



global constant

 lstFlavonoids = create(wxListCtrl,{Win,-1,-1,-1,-1,-1,HRULES})



void = insert_list_column(lstFlavonoids,0,"flavonoid",0,250)

void = insert_list_column(lstFlavonoids,1,"in 100g food",0,100)

void = insert_list_column(lstFlavonoids,2,"in 100g diet",0,-1)



global constant

 lblSelectedFood = create(wxStaticText,{Win,-1,"Selected Food"})

 add_window_to_sizer(boxLeft,lstFlavonoids,1,wxGROW,0)



global constant

 lstDiet = create(wxListCtrl,{Win,-1,-1,-1,-1,-1,HRULES}),

 lstFoods = create(wxListCtrl,{Win,-1,-1,-1,-1,-1,HRULES})



void = insert_list_column(lstDiet,0,"food",0,200)

void = insert_list_column(lstDiet,1,"grams",0,150)

void = insert_list_column(lstDiet,2,"flavonoid",0,150)



void = insert_list_column(lstFoods,0,"food",0,300)

void = insert_list_column(lstFoods,1,"flav/100g",0,200)



 add_window_to_sizer(boxRight,lstDiet,1,wxGROW,0)

 add_window_to_sizer(boxRight,lstFoods,1,wxGROW,0)



wxMain(frameWin)



new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu