Update gtk108
This commit is contained in:
parent
22074d37a4
commit
694a58fda7
|
@ -1,8 +1,20 @@
|
|||
#include "MyWin.hh"
|
||||
#define bin_str 6
|
||||
|
||||
int main(int argc,char **argv){
|
||||
//Get binary dir
|
||||
const char * src = *argv;
|
||||
int len = strlen(src); //argv[0]
|
||||
char * tmp = (char*)malloc(len);
|
||||
#ifdef _WIN32
|
||||
strncpy(tmp,src,len-bin_str-4);
|
||||
tmp[len-bin_str-4]='\0';
|
||||
#else
|
||||
strncpy(tmp,src,len-bin_str);
|
||||
tmp[len-bin_str]='\0';
|
||||
#endif
|
||||
//Initalize env
|
||||
Glib::setenv("GSETTINGS_SCHEMA_DIR",".",false);
|
||||
Glib::setenv("GSETTINGS_SCHEMA_DIR",tmp,false);
|
||||
|
||||
//Create a application and run
|
||||
auto app=Gtk::Application::create(argc,argv,"org.gtk.daleclack");
|
||||
|
|
6
c/args.c
6
c/args.c
|
@ -6,7 +6,13 @@ int main(int argc,char **argv){
|
|||
const char * src = *argv;
|
||||
int len = strlen(src); //argv[0]
|
||||
char * tmp = malloc(len);
|
||||
#ifdef _WIN32
|
||||
strncpy(tmp,src,len-8);
|
||||
tmp[len-8]='\0';
|
||||
#else
|
||||
strncpy(tmp,src,len-4);
|
||||
tmp[len-4]='\0';
|
||||
#endif
|
||||
printf("%s\n",tmp);
|
||||
free(tmp);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue