2d.wxWidgets – Platform Info

OVERVIEW

These are predefined functions which retrieve various information about the current system.

SAMPLE CODE

platform.cpp
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
	#include <wx/wx.h>
#endif
#include <wx/utils.h>

int main(int argc, char **argv) {
	wxInitialize();
  	wxPuts(wxGetHomeDir());
	wxPuts(wxGetHostName());
	wxPuts(wxGetUserName());
	wxPuts(wxGetOsDescription());	
	wxUninitialize();
}

The output is given below:

/home/amit
 ubuntu-amit
 amit
 Linux 5.4.0-91-generic x86_64

1 Trackback / Pingback

  1. 1.wxWidgets – Introduction – Truelogic Blog

Leave a Reply

Your email address will not be published.


*