site  contact  subhomenews

Proxy-server setup GUI

November 16, 2010 — BarryK
As announced in the previous blog post, I have written a proxy-server setup GUI application:

http://bkhome.org/archive/blog2/201011/my-first-gtk-bacon-application.html

After discussion on the forum and my blog about the need for such a tool:

http://bkhome.org/archive/blog2/201011/wget-and-proxy-servers.html

The application is now in Woof, at /usr/local/simple_network_setup/proxy-setup, and is integrated into the Internet Connection Wizard.

I had some feedback about my proxy-setup GUI truncating text if the font size is too big, and vovchik (who is one of our BaCon gurus) kindly enhanced my code to compensate for this, plus other improvements.

However, I have taken a different approach, as an experiment. At the beginning of the program I have this:

REM try to set font size to fit window... ex: xdpy=107 xftdpi=78

xdpi=VAL(EXEC$("xdpyinfo | grep -o 'resolution: .*' | tr -s ' ' | cut -f 2 -d ' ' | cut -f 1 -d 'x'"))
xftdpi=VAL(EXEC$("grep '^Xft.dpi:.*' /root/.Xresources | tr -s ' ' | cut -f 2 -d ' '"))
REM my weird formula...
fontsize=12.0*(78.0/xftdpi)*(107.0/xdpi)
fontsize_mono=fontsize
fontsize$=STR$(fontsize)
fontsize_mono$=STR$(fontsize_mono)
font_sans$=CONCAT$("DejaVu Sans ",fontsize$)
font_mono$=CONCAT$("Monospace ",fontsize_mono$)


Then in the code I use the FONT() function to set the text in widgets to that font and size. I did some basic experiments and it seems to work ok.

Tags: woof