Hey there,
jos...@main.nc.us wrote:
>I researched this a little bit.
>
>dialog.info_dialog(title="Information", message="junk works",
>width="300")
>
>bombs in autokey-qt, but works fine in autokey-gtk.
Yep. I don't know why. Take off the width option and it will work in
AutoKey (Qt):
dialog.info_dialog(title="foo", message="bar")
I tried using geometry to specify the size, but haven't managed it
yet. All I've been able to do is control its position with partial
geometry:
dialog.info_dialog(title="foo", message="bar", geometry="+300+400")
This version works just like the previous one and puts the dialog in
the same place on the screen, but doesn't affect its size:
dialog.info_dialog(title="foo", message="bar",
geometry="100x200+300+400")
All other efforts to use geometry (bad syntax: 100+200+300+400 or
+100+200+300+400 or 100x200x300x400 or x100x200x300x400) failed. You
might have better luck with some of your experiments.
I have to say that it would have been nice if the developers had put
real-world examples in for all of these API calls rather than just
giving us partial usage information to decipher.
If it helps any, I used the current LTS of Kubuntu and AutoKey (Qt)
version 0.95.10 for these tests.
>I had to put the 300 in quotes to avoid an exception.
Yes, always. AutoKey will only ever accept strings as options for
dialogs, so you'll have to get creative at times when testing
options that aren't documented that might just happen to work.
>So, you have to use options that the dialog manager likes - which
>means, among other things, that you have to detect which front end
>is running to know what options you can use.
Yes, that seems to be a bit of a problem.
We should probably clearly distinguish between them by being very
clear which front end each is for:
gtkdialog.info_dialog(title="foo", message="bar")
vs
kdialog.info_dialog(title="foo", message="bar")
In the meanwhile (or if that's not advisable), we'll certainly want
to comment our code to remind ourselves which front end a script with
dialogs is intended for or at least brace ourselves for occasional
failure as the result of choosing the wrong front end for a script.
>Is there something like a man kdialog somewhere? I found tutorials,
>etc., but nothing that just lists dialogs and their available
>options.
No man page, oddly enough, but kdialog --help is somewhat useful.
Then there's always my blog page, but I may have overlooked something
and it still needs me to finish the huge overhaul I'm doing on it.
It's mostly done, but not fully, so I've got a heavily-updated copy
on my drive, but the old one is still online. Perhaps this is the
kick in the pants I need to get that done.
>I also saw something where the first two arguments to kdialog were
>the width and height for the box, but with no explanations, etc.
Yep, that's geometry. It works like this in a regular KDialog:
--geometry 100x200+300+400
I believe that's:
--geometry[HEIGHT]x[WIDTH]+[X-OFFSET]+[Y-OFFSET]
But don't quote me on that. I didn't test it just now (I'm not
currently in KDE) and the width and height could be backwards.
You can also break it up to specify just the height and width or just
the x and y offsets:
--geometry 100x200
--geometry 300+400
The AutoKey option should accept this, but it ignores the height and
width and only honors the x and y offsets:
geometry="100x200+300+400"
If you then dare to add a width option to the command, the script
will silently fail.
>I'm going to ask them.
I'll be interested in their reply, especially if they say why they
never made it a man page.
>I love KDE, but I hate their documentation!
Same here, but creating it will be a big job.