1. wxEuphoria: sizing of widgets - win vs lnx
- Posted by Jerry Story <jstory at ocii.com> Dec 17, 2005
- 527 views
- Last edited Dec 18, 2005
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.
2. Re: wxEuphoria: sizing of widgets - win vs lnx
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Dec 18, 2005
- 517 views
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
3. Re: wxEuphoria: sizing of widgets - win vs lnx
- Posted by Jerry Story <jstory at ocii.com> Dec 19, 2005
- 506 views
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)
4. Re: wxEuphoria: sizing of widgets - win vs lnx
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Dec 19, 2005
- 511 views
Jerry Story wrote: > > Here it is. On Linux the widgets are okay. On Windows the widgets are bunched > in the upper left corner. That's really strange. It works correctly under windows if you create the menus before you create the panel. I have no idea why this is. If you resize the window, it also seems to correct itself. I'll put some info about this in the docs (probably under the "Known Bugs" section for windows). Matt Lewis
5. Re: wxEuphoria: sizing of widgets - win vs lnx
- Posted by cklester <cklester at yahoo.com> Dec 19, 2005
- 511 views
Jerry, here's how I get around this: First, set the window to anything but what you ultimately want: frameWin = create(wxFrame,{0,1,PROGRAM_TITLE,-1,-1,901,601}), -- off by 1 Then, do this: set_size( frameWin, 900,600 ) -- set to what you really want wxMain(frameWin) -=ck "Programming in a state of Euphoria." http://www.cklester.com/euphoria/