1. EuGTK: "font"
- Posted by Jerry_Story Feb 19, 2012
- 2171 views
I was sidetracked with a Javascript project.
http://jtstory.fortunecity.com/dmak-javascript/dmak-js.html
(The data takes a while to load.)
But now I'm back on the EuGTK-based project.
set(lstNutrientsREQ,"font",fonts[NUTRIENTS_REQ]) -- lst means list -- line 57 set(lstNutrientsNonREQ,"font",fonts[NUTRIENTS_NONREQ]) set(lstFoods,"font",fonts[FOODS]) set(lstRecipes,"font",fonts[FOODS]) set(lstDiet,"font",fonts[DIET]) set(txtFilter1,"font",fonts[TEXT]) -- txt means text set(txtFilter2,"font",fonts[TEXT]) set(txtFilter3,"font",fonts[TEXT]) set(btnDec,"font",fonts[TEXT]) -- btn means button set(btnSA1,"font",fonts[TEXT]) set(btnCA1,"font",fonts[TEXT]) set(btnCals,"font",fonts[TEXT]) set(btnCA2,"font",fonts[TEXT]) set(btnSA2,"font",fonts[TEXT]) set(btnInc,"font",fonts[TEXT]) set(lblSelectedFood,"font",fonts[LABELS]) -- lbl means label set(lblSelectedNutrient,"font",fonts[LABELS]) set(btnFave,"font",fonts[TEXT]) set(btnCrap,"font",fonts[TEXT])
"font" seems to be not correct on some of them.
.../GtkEngine.e:337 in function set() A machine-level exception occurred during execution of this statement ... /dmak_fonts.e:57
2. Re: EuGTK: "font"
- Posted by irv Feb 23, 2012
- 1970 views
Need more info. Is lstNutrientsREQ a ListView, or a column, or ?
3. Re: EuGTK: "font"
- Posted by Jerry_Story Feb 23, 2012
- 1940 views
Need more info. Is lstNutrientsREQ a ListView, or a column, or ?
lstNutrientsREQ = create(GtkTreeView), lstNutrientsNonREQ = create(GtkTreeView), lstDiet = create(GtkTreeView), lstFoods = create(GtkTreeView), lstRecipes = create(GtkTreeView)
4. Re: EuGTK: "font"
- Posted by irv Feb 24, 2012
- 1899 views
Jerry: try running with -d SET to display the 'method' that is being called at that point, as well as the value of the pointer being passed. That might tell us something.
5. Re: EuGTK: "font"
- Posted by Jerry_Story Feb 24, 2012
- 1865 views
Jerry: try running with -d SET to display the 'method' that is being called at that point, as well as the value of the pointer being passed. That might tell us something.
That produces a huge amount of information. Here is a portion of it that might be relevant.
SET: font GtkTreeView { "override_font", {33554436,150994948}, 0, 2517 } { 604291344, "Georgia Bold 12" } SET: font GtkTreeView { "override_font", {33554436,150994948}, 0, 2517 } { 604291904, "Georgia Bold 12" } SET: font GtkTreeView { "override_font", {33554436,150994948}, 0, 2517 } { 604293024, "Georgia Bold 12" } SET: font GtkTreeView { "override_font", {33554436,150994948}, 0, 2517 }
6. Re: EuGTK: "font"
- Posted by irv Feb 28, 2012
- 1654 views
Jerry: try running with -d SET to display the 'method' that is being called at that point, as well as the value of the pointer being passed. That might tell us something.
That produces a huge amount of information. Here is a portion of it that might be relevant.
SET: font GtkTreeView { "override_font", {33554436,150994948}, 0, 2517 } { 604291344, <== pointer to object being affected "Georgia Bold 12"
OK, the next step is to see if somehow you're getting an invalid pointer to the TreeView - just after you create the TV, you can put a line to print the value of the pointer, then compare it with the <== marked value in the debug output.
As a work-around, you can always set the font on a per-column basis, see test33.ex for examples of this. e.g:
constant col3 = create(GtkTreeViewColumn,"type=text, text=#1, font='Mono 10'")
7. Re: EuGTK: "font"
- Posted by Jerry_Story Feb 28, 2012
- 1617 views
That produces a huge amount of information. Here is a portion of it that might be relevant.
SET: font GtkTreeView { "override_font", {33554436,150994948}, 0, 2517 } { 604291344, <== pointer to object being affected "Georgia Bold 12"
OK, the next step is to see if somehow you're getting an invalid pointer to the TreeView - just after you create the TV, you can put a line to print the value of the pointer, then compare it with the <== marked value in the debug output.
global constant lstNutrientsREQ = create(GtkTreeView), lstNutrientsNonREQ = create(GtkTreeView), lstDiet = create(GtkTreeView), lstFoods = create(GtkTreeView), lstRecipes = create(GtkTreeView) printf(1,"%d \n",{lstNutrientsREQ}) printf(1,"%d \n",{lstNutrientsNonREQ}) printf(1,"%d \n",{lstDiet}) printf(1,"%d \n",{lstFoods}) printf(1,"%d \n",{lstRecipes})
That produces different numbers each run.
1st run: 578855000 578855560 578856120 578856680 578857240 2nd run: 591216728 591217288 591217848 591218408 591218968
If I do
eui -d SET dmak.exw
there is so much information that I can't find the above numbers and I can't compare them with the -d SET numbers.
8. Re: EuGTK: "font"
- Posted by irv Mar 01, 2012
- 1538 views
It will produce different numbers each run, since they're pointers to the structure in memory. As for finding the # in the output, eui -d SET yourprog.ex > debug.txt then grep it!
A machine-level exception is pretty rare, even when developing the library, so I don't have a lot to go on or a good idea where to start debugging. I don't mind trying, if you want to zip up your program and send it to me. irvmull at gmail
9. Re: EuGTK: "font"
- Posted by Jerry_Story Mar 01, 2012
- 1511 views
The numbers seem to be correct.
This line:
printf(1,"lstNutrientsREQ = %d \n",{lstNutrientsREQ})
produces:
lstNutrientsREQ = 576471128
This line:
set(lstNutrientsREQ,"font",fonts[NUTRIENTS_REQ])
produces:
SET: font GtkTreeView { "override_font", {33554436,150994948}, 0, 2517 } { 576471128, <-- same number "Georgia Bold 12" }
10. Re: EuGTK: "font"
- Posted by irv Mar 01, 2012
- 1508 views
The numbers seem to be correct.
This line:
printf(1,"lstNutrientsREQ = %d \n",{lstNutrientsREQ})
produces:
lstNutrientsREQ = 576471128
This line:
set(lstNutrientsREQ,"font",fonts[NUTRIENTS_REQ])
produces:
SET: font GtkTreeView { "override_font", {33554436,150994948}, 0, 2517 } { 576471128, <-- same number "Georgia Bold 12" }
Edited to remove suggestion, we already know it is the correct class. I need the source to get to the bottom of this error.
11. Re: EuGTK: "font"
- Posted by irv Mar 05, 2012
- 1447 views
Apparently the error has nothing to do with fonts, but was caused by memory corruption elsewhere. Fortunately, this is pretty rare, since it's close to impossible to track down.
12. Re: EuGTK: "font"
- Posted by mattlewis (admin) Mar 05, 2012
- 1465 views
Apparently the error has nothing to do with fonts, but was caused by memory corruption elsewhere. Fortunately, this is pretty rare, since it's close to impossible to track down.
This is where valgrind really shines. The easiest way to diagnose is probably to translate your program with debugging turned on, and then run it under valgrind:
$ valgrind ./myapp
Matt