Alan:
I agree that to set the default value to lo0 is not useful, but the code 
I modified (which we call a display file)  is a XML like file, and can 
insert Python style script, the original code
I modified from is:
 <script><![CDATA[

    iface = "eth0"
   
    def prefs_cb(key, value):
   
        if (key == "iface"): sys.iface = value
        else: sc_prefs_cb(key, value)
This code is used to initialize the network device that the widget use 
to monitor. In Linux, the name of first network device is always eth0, 
so they hardcoded eth0 here, but we
use the device name eg. bge0 in Solaris. We cannot import any module in 
this kind of python script, and its almost impossible to get current the 
name of current active network device
here, So I set the initial value to lo0, and user can always configure 
the widget to monitor the device they are intersted in.

Wish this could be helpful

Chris

Alan Coopersmith wrote:
> Without context it's hard to tell, but setting the network display to
> display traffic over the loopback interface hardly seems useful.
>
>     -Alan Coopersmith-           alan.coopersmith at sun.com
>      Sun Microsystems, Inc. - X Window System Engineering
>
> C Wang wrote:
>> --- Displays/SideCandy/network.display.old    Sat Jan 22 06:35:47 2005
>> +++ Displays/SideCandy/network.display    Tue Feb 13 18:28:31 2007
>> @@ -125,7 +125,7 @@
>>  
>>    <script><![CDATA[
>>  
>> -    iface = "eth0"
>> +    iface = "lo0"
>>           def prefs_cb(key, value):
>>      
>


Reply via email to