Re: [gDesklets] Newbie Developer Control Question



Hi Sean,

Sean Bridges wrote:
Control Functions would need to be:
* Handle grabbing Meta-data from image uri. * Handle building a list of uris to pictures to display based on a
passed directory.  Provide maybe a next picture, previous picture call
that is hooked to a timer.  (Doesn't appear to be a standard 'directory'
chooser preference, so that might have to just be a string for now?)

We don't have a directory chooser, but that's a very good idea. Perhaps something for 0.40.

If I understand right each of these functions would need to happen
inside a control, not possible from a display. Is that correct?

Yes. That's correct. Basically display-files can't do anything that is not (a) done through the ADL-language (the xml you use to define the displays), (b) done through a control, (c) built in Python (the stuff you get when you do python -i and don't import anything)

I browsed through the controls on the site and I didn't find any that
appeared to help with this.  Is there anything out there that I should
re-use?

Can't think of anything if you found nothing on the official site (gdesklets.de) or on the archive that can be found through the official site.

Finally, if I have to make a control, I'm thinking it should be called
something like ImageManipulation.  Methods could be added do resizing or
transitions later down the road.

Sounds very reasonable. First I'd start thinking about the property-based control interface. For the requirements you mentioned earlier, I'd say you need something like this (just an example):

image_uri <- set this to the target image...
meta_data <- ... and then read this to get the meta-data in a dictionary
pictures <- get/set to manipulate the list of pictures
start_slideshow <- start a loop do show pictures
next_picture <- switch to next picture manually
prev_picture <- ....

Then you just build the functions that handle getting and setting those python properties.

If you have any questions feel free to post them on the list!


- Lauri
--
  > lauri(AT)sokkelo.net <
  > +35840 722 5101      <



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