Re: [gDesklets] Control for Requesters (IInformer, IInformant, IInteraction, IRequester, ...??)



Hi again,

OK, more on this one ;).

I think it would be a good idea to have some basic data about the
display (like e.g. the path and the metadata) available within the
Display itself and the Controls started by the Display.
But these are major changes and enhancements that might better be pushed
to 0.37 ?! (I will set up a detailed mail on the ML about this later)
Anyway: right now it seems to be better and easier to support
stock-icons only for the main icon right now.

Soooo... I just committed the first version of IPopUp to the 0.3x branch
(see rev.#158).

Feel free to test ;). For a starting point just use the demo display
file (requestertester.display) at the bottom of this mail.

Right now there seems to be only one major issue left:
The window is not destroyed when the desklet is restarted and/or
deleted. The "destroy with parent" is not working...
Any idea ?

Still to come:
- alignment of the elements (icon, text etc.)

Further ideas, comments, suggestions etc. ?!

Otherwise... what about packing it all to RC1 ??! ;).


Greetings, Bjoern



requestertester.display:
--------
<?xml version="1.0" encoding="UTF-8"?>

<display window-flags="below" width="300" height="100" bg-color="white">
  <meta author="H.Humpel (Bjoern Koch)"
        name="Requester Tester"
        version="0.1"
        description="Test Display for the IPopUp Control."
        category="Test"
        icon=""
        preview="flush.png"
        website="http://gdesklets.info";
        license="GPL-2"
        copyright="©2010 H.Humpel for the gDesklets Team ;)" />

  <control id="main_requester" interface="IPopUp"/>
  <control id="simple_requester" interface="IPopUp"/>
  <control id="informer_requester" interface="IPopUp"/>
  <control id="fancy_requester" interface="IPopUp"/>

  <label id="label1a" font="Sans 20px" color="black" value="Requester: "/>
  <label id="label1b" font="Sans 20px" color="black" value="..."
relative-to="label1a,x"/>
  <label id="label2a" font="Sans 20px" color="black" value="Action: "
relative-to="label1a,y"/>
  <label id="label2b" font="Sans 20px" color="black" value="..."
relative-to="label2a,x"/>


  <script><![CDATA[

def askme_event_handler(event):
  main_requester.visible = True
  Dsp.label2b.value = str(event)


def main_event_handler(event):
  if (event == "simple"):
    simple_requester.visible = True
  elif (event == "informer"):
    informer_requester.visible = True
  elif (event == "fancy"):
    fancy_requester.visible = True
  Dsp.label1b.value = str(event)


# set up the "simple" requester
simple_requester.text = "I just need your opinion here!"
simple_requester.icon = ("gtk-dialog-question")
simple_requester.buttons = [("ok", "gtk-ok"), ("cancel", "gtk-cancel")]
simple_requester.visible = False
simple_requester.bind("event", askme_event_handler)


# set up the "informer" requester
informer_requester.text = "Just want to let you know: everything is OK!"
informer_requester.icon = ("gtk-about", "left")
informer_requester.buttons = [("ok", "Oh well....", "gtk-ok")]
informer_requester.visible = False
informer_requester.bind("event", askme_event_handler)


# set up the "fancy" requester
fancy_requester.text = "<span foreground='#FF0000' background='blue'
size='10000'>Pango</span> in <b>action!</b>"
fancy_requester.icon = ("gtk-dialog-warning", "top")
fancy_requester.buttons = [("great", "Great!"), ("notbad", "Not too
bad..."), ("seenit", "Seen it before.")]
fancy_requester.visible = False
fancy_requester.bind("event", askme_event_handler)


# set up the "main" requester
main_requester.text = "Just a simple example..."
main_requester.buttons = [("simple", "Simple"), ("informer",
"Informer"), ("fancy", "Fancy")]
main_requester.visible = True
main_requester.bind("event", main_event_handler)

Dsp.label1b.value = "main"

]]></script>
</display>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]