Re: Unified libraries to allow porting code to other oses
- Posted by jmduro May 23, 2015
- 2957 views
What does the latter have to do with the former? wxWidgets might use different names for different classes, but the same naming scheme would apply across all wxWidget supports platforms.
I probably don't understand the question. The source code might be the best support for an answer. To set text I have a set of functions
atom wxClass = getClass(wxId) if find(wxClass, {wxListCtrl, wxListBox, wxChoice}) then set_string( wxId, param-1, text ) elsif find(wxClass, {wxFrame, wxButton, wxStaticText, wxComboBox, wxRadioBox}) then set_label ( wxId, text ) elsif (wxClass = wxStatusBar) then if sequence(id) then set_status_text( wxId, text, param-1) else set_status_text( wxId, text, 0 ) end if elsif (wxClass = wxTextCtrl) then set_text( wxId, text ) end if
To get text, I have another set of functions, but function names to get text are not always coherent with functions to set text:
if find(wxClass, {wxListCtrl, wxListBox, wxChoice, wxComboBox}) then text = get_string_selection( wxId ) elsif find(wxClass, {wxFrame, wxButton, wxStaticText, wxRadioBox}) then text = get_label ( wxId ) elsif (wxClass = wxStatusBar) then if sequence(id) then text = get_status_text( wxId, param-1) else text = get_status_text( wxId, 0 ) end if elsif (wxClass = wxTextCtrl) then if sequence(id) then text = get_text_line( wxId, param-1 ) else text = get_text_value( wxId ) end if end if
set_string but get_string_selection, set_text but get_text_line or get_text_value. I spend a lot of time to find the correct function names according to the classes, and sometimes the documentation is outdated and refers to non-existing names. With the wxSimple library, users avoid this problem.
Even something like winSimple (which imvho is very badly named, as it sounds windoze-centric) would be a lot of effort.
It is badly named, that's right, but winSimple is windows-centric, it does not only sound windows-centric. It has just a syntax which is common to wxSimple or linSimple.
Wouldn't this break the desired goal, cross compatibility? Any program that uses the standard wxEuphoria functions would not be able to change the library from wxSimple to winlibSimple.e without having someone manually addressing issue of the advanced calls.
wxSimple will never be exhaustive and do it all. I don't think I can achieve a unique cross-platform library. There will always be something specific to a platform or to a GUI. For example wxWidgets supports networking, win32lib does not. So the goal is not to get full cross compatibility: it is to let people do easily 80% of the porting job and let advanced users help them terminate with the remaining 20%.
Regards
Jean-Marc