Wednesday, December 30, 2009

More Quidget One-Liners: Yes/No, Warnings, Info, Errors





Last night I spent some time working on bug #500911, adding some more useful functions to the quidgets.prompts namespace.

quidgets.prompts.yes_no() works like this:
  response = quidgets.prompts.yes_no("I need some info","Do you want to give me a yes or no?")
if response == gtk.RESPONSE_YES:
print "they said yes"
elif response == gtk.RESPONSE_NO:
print "they said no"
else:
print "they dismissed the dialog"
This is a little different than the other functions in the namespace in that in that the responses are gtk.RESPONSE_YES or gtk.RESPONSE_NO, rather than gtk.RESPONSE_OK, or gtk.RESPONSE_CANCEL. Of course, there is no "value", as you are just looking for a yes or no from the user.

Warning, Error, and Info are similar, but you don't even check the return value, as you are not seeking any feedback. You just supply a title and some text that you are trying to tell the user.

So:
quidgets.prompts.warning("Title goes here","Warning")
quidgets.prompts.error("Title goes here","Error")
quidgets.prompts.info("Title goes here","Info")
I hope that folks find this useful, and that it saves writing lots of lines of code. I've pushed the branch, and should get it into my PPA in the next few days.

About Quidgets
Quickly + Widgets = Quidgets
There is a Launchpad Project for Quidgets
The most up to date changes are in the Quidgets Trunk Branch

18 comments:

  1. Quidgets is starting to look a lot like zenity, which is great. Perhaps you could look at the ones zenity offers for ideas on things people use often.

    Thanks for your awesome work,
    Daniel

    ReplyDelete
    Replies
    1. The Raving Rick: More Quidget One-Liners: Yes/No, Warnings, Info, Errors >>>>> Download Now

      >>>>> Download Full

      The Raving Rick: More Quidget One-Liners: Yes/No, Warnings, Info, Errors >>>>> Download LINK

      >>>>> Download Now

      The Raving Rick: More Quidget One-Liners: Yes/No, Warnings, Info, Errors >>>>> Download Full

      >>>>> Download LINK TE

      Delete
  2. added bug 501804

    https://bugs.edge.launchpad.net/quidgets/+bug/501804

    ReplyDelete
  3. Yay that solves my blog post from a week ago thanks rick :D

    ReplyDelete
  4. Don't use Yes/No - that is a bad, bad Windows paradigm. Use VERBS on buttons instead of asking Yes/No questions.

    ReplyDelete
  5. I agree with Rich. "Close without saving", "Continue editing" and "Save as" are much better buttons then Yes/No/Cancel.

    ReplyDelete
  6. Perhaps adding a default minium width will improve the layout of the smaller dialogs. The examples look to me a little squashed.

    ReplyDelete
  7. Nice, though I don't really see how this is useful given that gtk.MessageDialog does the same and is already quite simple.

    I also agreed with Rich and flimm in that Yes/No dialogues really suck. Further, I believe dialogues should be avoided whenever possible (by using morphing windows, embeded messages like gedit/Firefox do, etc.), but I suppose those one-liners are intended for people writing little scripts for personal usage, so this isn't really applicable anyway.

    By the way Rick, please poke me when you're on IRC, I'd like to talk to you about something else related to Quidgets :).

    ReplyDelete
  8. Thanks for sharing nice post.
    https://proscrack.co/any-video-converter-ultimate-crack/

    ReplyDelete
  9. You done an excellent job.
    https://crackvip.com/simlab-composer-keygen/

    ReplyDelete
  10. The Raving Rick: More Quidget One-Liners: Yes/No, Warnings, Info, Errors >>>>> Download Now

    >>>>> Download Full

    The Raving Rick: More Quidget One-Liners: Yes/No, Warnings, Info, Errors >>>>> Download LINK

    >>>>> Download Now

    The Raving Rick: More Quidget One-Liners: Yes/No, Warnings, Info, Errors >>>>> Download Full

    >>>>> Download LINK gd

    ReplyDelete