Fri, Nov 22, 7:15 AM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: wxpython - add label to wx.BitmapButton?


Netherworks ( ) posted Sat, 08 May 2010 at 6:58 PM · edited Fri, 22 November 2024 at 7:11 AM

Heyas,

I am trying to work with Poser 8/Pro 2010 wxpython.  I created a blank button .bmp that I'm using as a template for buttons in a panel.  I am wondering if there is a way to add text to the blank buttons without having to use a different graphic for each button.

I am using wx.BitmapButton to utilize the buttons but can't seem to figure out a simple way, other than making a dozen different graphics, to add text to them.

I haven't been able to find a lot of information or examples of this.  The wxpython documentation online reads worse than stereo instructions.

.


semidieu ( ) posted Tue, 11 May 2010 at 4:40 AM

I dont think it's possible (at least not easily - you will perhaps need to 'completely' rework the class).

Depending on what you do, why not using a simple button with different background colors ?


Netherworks ( ) posted Tue, 11 May 2010 at 1:18 PM

Yeah, I went with wx.lib.buttons.GenButton instead of Button (or BitmapButton) because you can customize it a bit more.  I'm a stickler for having things look halfway decent visually.   I first tried Button but it wants to use windows colors.  I set fore and background colors but there's still a border around the buttons and I prefer them in this case to be flat.

If I didn't need it to be a panel, I'd be using tkinter instead because in some ways tkinter is easier to deal with.  It's something that I wanted to be out all the time and dock.

What I made, if you're curious, is a "toolbar" (a panel with no caption) that can quickly switch camera views.

.


semidieu ( ) posted Tue, 11 May 2010 at 2:06 PM

Oh, that would be very nice :)

By the way, for the question you asked me by email, I didn't made something similar, so I don't know. From what I searched, it should behave the same way... But Mac never behave the same :)


Netherworks ( ) posted Tue, 11 May 2010 at 6:54 PM

file_452712.jpg

Yeah, I haven't been able to figure out how to make the buttons on the bar reorder.  There's 12 buttons and they are horizontal on one row.  I can't make them go 3x4 and so on by changing the pane size but would be cool if I could get it to work.

I could put it out there as a freebie and leave the code exposed if you are anyone wants to fiddle with it.  However, you might shriek in terror when you see my coding style :D

I've attached an image.  It does remember it's layout and if it's docked or not (using pickle).  You can right click in an empty space to get the floating/docked menu.  I tried to make it visually fit in with the UI.

.


semidieu ( ) posted Wed, 12 May 2010 at 7:34 AM

That's really nice !

Why don't get the panel width and, depending of the size, make it two-three rows ?

Another way would be... to use a wx.listctrl, using icons ? (Dbl)-Click an item would select the camera and it does reorder automatically...


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.