Re: [Freevo-devel] Re: screen redraw

2004-10-30 Thread mplayer


>> Is there a simple answer or should I just
post what code I have?

> Better post the code so I can take a look.

Here you go.  Probably something fundamental that I still don't understand.


#python modules
import os, time, stat, re, copy

#freevo modules
import config, menu, rc, plugin, skin, osd, util
from gui.PopupBox import PopupBox
from gui.InputBox import *
from item import Item

#get the singletons so we get skin info and access
the osd
skin = skin.get_singleton()
osd  = osd.get_singleton()

skin.register('configuration', ('screen', 'title',
'info', 'plugin'))

class PluginInterface(plugin.MainMenuPlugin):
    """
    """
    # make an init func that creates the
cache dir if it don't exist
    def __init__(self):
        plugin.MainMenuPlugin.__init__(self)

    def items(self, parent):
        return [ ConfigurationMainMenuItem(parent)
]
    
class ConfigurationMainMenuItem(Item):
    """
    this is the item for the main menu and
creates the list
    of SubItems
    """
    def __init__(self, parent):
        #what image shows on the
main menu
        Item.__init__(self, parent,
skin_type='commands')
        self.name = _('Configuration')

    def actions(self):
        """
        return a list of actions
for this item
        """
        items = [ ( self.createConfigurationMenu
, _('Configuration Menu' )) ]
        return items
 
    def createConfigurationMenu(self, arg=None,
menuw=None):
        menuitems = []
        menuitems += [NetworkItem(self)]
 
        configurationMenu = menu.Menu(_('Configuration'),
menuitems)
        menuw.pushmenu(configurationMenu)
        menuw.refresh()

class NetworkItem(Item):
    def __init__(self,parent):
        Item.__init__(self,parent)
        self.name=_('Network')
        config.IP_ADDRESS='192.168.1.123'
        
    def actions(self):
        items = [(self.getlines,
_('Show Network Settings'))]
        return items

    def getlines(self, arg = None, menuw=None):
        lines=[]
        mi = menu.MenuItem('IP
Address : '+config.IP_ADDRESS, self.editIP, 0)
        mi.arg=(mi, menuw)
        lines.append(mi)
        networkMenu = menu.Menu(_('Network
Settings'), lines)
        menuw.pushmenu(networkMenu)
        menuw.refresh()
        
    def editIP(self, arg=None, menuw=None):
        ShowIP(arg)


class ShowIP:
    """
        Stub class - doesn't
do anything other than allow the edit of a word and 
        update the menu
with the updated word
    """
    def __init__(self, (item, menuw)):
        self.menuw = menuw
        self.item = item
        self.menuw.hide(clear=False)
        ipb = InputBox(text=_('Enter
new IP'), input_text = _(config.IP_ADDRESS), handler=self.modifyIP)
        ipb.show()
 
    def modifyIP(self, word=None):
        config.IP_ADDRESS=word
        self.item.name = 'IP Address
: ' + word
        skin.force_redraw=True
        self.menuw.show()
        return









[Freevo-devel] Re: screen redraw

2004-10-30 Thread Dirk Meyer
[EMAIL PROTECTED] wrote:
> Hi, freevo development newbie here.

Hi

> I want to edit some configuration variables on the fly.

Cool.

> I've made a menu structure (which works),
> and in a MenuItem, called a class to display an InputBox (which works).
> However, when I hit enter on the InputBox, it doesn't disappear.
> It does lose focus and I can move back up the menu structure, but when I 
> come back down,
> the InputBox is still displayed.

That's strange. There is a self.destroy() in the code for enter.

> Is there anyway I can force the screen to redraw?
> the functions menuw.redraw(), menuw.rebuild_page(), menuw.refresh(1), 
> menuw.show()
> don't seem to do the trick.
> menuw.hide(clear=True) and then menuw.show() does rebuild the page, but 
> then I get an annoying black screen flicker.

That's only a baf hack. You can set force_redraw (or similar) in the
skin. But that is not they way it should work.

> Is there a simple answer or should I just post what code I have?

Better post the code so I can take a look.


Dischi

-- 
Backup not found!  A)bort, R)etry or P)anic?


pgpEPpuM5iQkN.pgp
Description: PGP signature


[Freevo-devel] Re: xine framebuffer issues..

2004-10-30 Thread Dirk Meyer
mike lewis wrote:
>> We wait 5 seconds until we kill -9 xine. That should be enough. Maybe
>> find the bug in xine? :)
>>
> Maybe that was the originalidea, but I think it *feels* more like 5
> miliseconds.  If I change the times delay from time.speep(0.1) to
> (0.3) , it works, 0.2 workshalf the time..

OK, I increased the time to wait in the upcoming 1.5.2


Dischi

-- 
On-line, adj.:
The idea that a human being should always be accessible to a computer.


pgpdiF7JejEQF.pgp
Description: PGP signature


Re: [Freevo-devel] Re: xine framebuffer issues..

2004-10-30 Thread mike lewis
> We wait 5 seconds until we kill -9 xine. That should be enough. Maybe
> find the bug in xine? :)
>
Maybe that was the originalidea, but I think it *feels* more like 5
miliseconds.  If I change the times delay from time.speep(0.1) to
(0.3) , it works, 0.2 workshalf the time..

Mick


---
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
___
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel


Re: [Freevo-devel] screen redraw

2004-10-30 Thread mplayer

Always the case - just as I worked out
how to send to this list, 
I find the solution - "skin.force_redraw=True"
was the line I wanted.



Hi, freevo development newbie here.


I want to edit some configuration variables on the fly.

I've made a menu structure (which works), 
and in a MenuItem, called a class to display an InputBox (which works).

However, when I hit enter on the InputBox, it doesn't disappear.

It does lose focus and I can move back up the menu structure, but when
I come back down, 
the InputBox is still displayed. 

Is there anyway I can force the screen to redraw? 
the functions menuw.redraw(), menuw.rebuild_page(), menuw.refresh(1), menuw.show()

don't seem to do the trick. 
menuw.hide(clear=True) and then menuw.show() does rebuild the page, but
then I get an annoying black screen flicker. 

Is there a simple answer or should I just post what code I have?


Rande 



[Freevo-devel] screen redraw

2004-10-30 Thread mplayer

Hi, freevo development newbie here.

I want to edit some configuration variables
on the fly.
I've made a menu structure (which works),
and in a MenuItem, called a class to
display an InputBox (which works).
However, when I hit enter on the InputBox,
it doesn't disappear.
It does lose focus and I can move back
up the menu structure, but when I come back down,
the InputBox is still displayed.

Is there anyway I can force the screen
to redraw?
the functions menuw.redraw(), menuw.rebuild_page(),
menuw.refresh(1), menuw.show()
don't seem to do the trick.
menuw.hide(clear=True) and then menuw.show()
does rebuild the page, but then I get an annoying black screen flicker.

Is there a simple answer or should I
just post what code I have?

Rande