Draw.Pupmenu.... maxrow? How?

I’m using PupMenu for a list that can get very long and go outside the size of the view…

sadly the list doesn’t scroll when too large so I just can’t reach those items…

It seems from the docs that I can use “maxrow” to split my list into multiple columns…

sadly it doesn’t work and alll I get are errors.


chan = Draw.PupMenu(Puplist)

works fine


chan = Draw.PupMenu(Puplist, maxrow = 20)

gives me TypeError: PupMenu() takes no keyword arguments…

here’s what the doc has to say:

(string, maxrow = None) - Display a pop-up menu at the screen.
The contents of the pop-up are specified through the 'string' argument,
like with Draw.Menu.
'maxrow' is an optional int to control how many rows the pop-up should have.
Options are followed by a format code and separated
by the '|' (pipe) character.
Valid format codes are
    %t - The option should be used as the title
    %xN - The option should set the integer N in the button value.

Ex: Draw.PupMenu('OK?%t|QUIT BLENDER') # should be familiar ...

I’m mystified.

sorry cannot help you right now with yourproblem for poup menu

in old 2.49 when the list was too long it created seperated columns for the list

is that what your trying to do here ?

ok i never use that function before

can you explain how you can print this definition

that might be very suefull to get info in 2.5 to learn more

thanks

Ricky, don’t forget that in python 3 print is a function rather than a statement… use print() rather than print…

so in 2.5 type in the console window:

print(dir(bpy.data))
and hit enter…
you’ll see all of the functions under bpy.data…

you can look at the results and go further:

print(dir(bpy.data.materials)) etc etc…

if the result of one of these shows a lot of items with double underscores around the names theres no more functions to be found…you should see one of the attributes is doc

you can then go

print(bpy.data.materials.doc)

which will show you the doc string…
most of these are “none” at the moment as they haven’t been written…

so not much help right now!

python 3.1

version 22647 is not using python 3.1 yet i think
it’s only 2.6 something
in any case i don’t have any python 3.1 installed yet unless it comes locally with 2.5 ?
but it’s not installed on my system vista 32 bits

i’ll test that you said for doc string and see what we can get

but where do you write this "
i mean direclty on the console ?
of in the text window on buttons window?

but your right i can’t wait till we get some more tut and odc to describe all theses

and if you find any good example let us know so can learn too!

Thanks

on windows I think they bundle 3.1 with blender 2.5 builds… don’t know because I’m on linux…
I’ll let you know,but right now I’m focusing on 2.49 'cause i need stability and a solid base now!

i think i will stick with 2.49 for production and speed for at least another year
depending when all the old scripst and stability comes along in 2.5

ok but where and how do you write that into the console ?

i tried to paste it into the console and nothing nada!

any idea how to do that ?

Thanks

Michael, you were close. You need to use:

chan = Draw.PupMenu(Puplist, 20)

So simply ditch the ‘maxrow’ keyword and you’re fine.
When I just tested it, it didn’t seem 100% precise though. The columns are often a little longer or shorter than what you assign it. Fortunately it will display all the options though.

smacks forehead!

Cool!

you are trying the “console” space type (new to 2.5) rather then the “windows” console right?
if so you just type into it…

btw… those commands will work fine within a script in the text editor too, just run the script from the text editor as usual … (that still gets output to the “windows” console rather than the built in one though…

space console on which planet is this ? LOL

i like to cut and past so simple and faster than to type
can we do that into the big black area on right side of the screen if that 's the space console form the menu on bottom header !

soon will be able to think and it will go straight into blender
may be next year who knows !
mind over PC

Thanks

wondering do you have a complete little script showing what it does ?

would be another interesting application to learn how ot do

Thanks