Forum: Poser - OFFICIAL


Subject: wxPYTHON: Immediate help needed please - probably only 10 minutes to solve

KarinaKiev opened this issue on Jun 21, 2019 ยท 16 posts


KarinaKiev posted Fri, 21 June 2019 at 1:04 PM

Hello @all:

I need a little help with a wxPython script, and urgently because I want to release SASHA-16 (2019 Edition) tomorrow.

Normally I prefer to fight my own way to learn how everything works. But this is one of the cases where my brain (or what's still left of it) has evaporated and I'm out of options.

Please have a look at this script:

import poser, wx

HeaderText = r"""NOTICE:"""

txt1 = r"""Karina's Python Scripts:"""

txt2 = r"""All my scripts can be more easily accessed in
            ->> KARINA's TOOL BOX <- 
                               (in the POSE library tab)"""

class InlineHelp(wx.Frame):

    
    
    def __init__(self, *args, **kw):
        on_top = wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP
        wx.Frame.__init__(self, None, title= HeaderText, style=on_top)
        self.InitUI()

    def InitUI(self):
            
        self.panel = wx.Panel(self)
        vbox = wx.BoxSizer(wx.VERTICAL)
        btn_vbox = wx.StdDialogButtonSizer()
        
        self.declareElements()
                
        self.btn1.SetPosition((190,100))
        self.btn1.SetDefault()
         
        self.btn1.Bind(wx.EVT_BUTTON, self.showFolder)

        font1 = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD)
        font2 = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.DEFAULT)
                
        st1 = wx.StaticText(self.panel, label=txt1, style=wx.ALIGN_LEFT)
        st2 = wx.StaticText(self.panel, label=txt2, style=wx.ALIGN_LEFT)

        st1.SetFont(font1)
        st2.SetFont(font2)

        if txt1:
            vbox.Add(st1, flag=wx.ALL, border=10)
            vbox.Add(self.btn1, flag=wx.ALL, border=10)

        self.panel.SetSizer(vbox)
        vbox.Fit(self)
        self.Centre()
    
    def declareElements(self):
        
        self.btn1 = wx.Button(self.panel, label = "[ SHOW FOLDER ANYWAY ]", size = (160,22))

    def showFolder(self, event):
        msg = ""
        if 1:
            # Don't bother with this part.
            print "This will now open the 'poserScripts' folder in the Poser native library"    
            
        else:
            msg = "An error ocurred. n n I don't have the slightest idea what caused it. n Sorry!"

        self.Destroy()
        if len(msg):
            poser.DialogSimple.MessageBox(msg)
        
    
    def abortProgram(self, event):
        self.Destroy()


def main():

    app = poser.WxAuiManager()
    ilh = InlineHelp(None)
    ilh.Show()

main()

and if you have a few minutes to spare, please format the two text elements and the "[ SHOW FOLDER ANYWAY ]" button so that they fit into the window (eventually rescaling the window too)...

. . Thank you a lot!!!

Karina


Cage posted Fri, 21 June 2019 at 11:45 PM

I'm not sure what the script is supposed to be doing, or what about it might need to be fixed, but I can bring it into Poser and try to work with it tomorrow. Can you clarify what the script is meant to do, and what problems it has?

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


an0malaus posted Sat, 22 June 2019 at 1:50 AM

Hi Karina, an0malaus here, in my old rendo guise. It's ages since I plowed through converting Ockham's tkInter Jiggles script to wxPython, but what I discovered during that is that all of the text and button objects need to be associated with a Sizer. I will have a look through my converted script and see what I can apply to yours, but it may take a while. I know well, the feeling of discovering the tip of an iceberg of yet-to-be-acquired-knowledge and wondering how to filter it to just the bits you need.

In return, I need someone to remind me how to create a signature for my posts. It's presumably called something else in my profile, but not signature...



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


an0malaus posted Sat, 22 June 2019 at 2:06 AM

The button [ Show Folder Anyway ] can pass default sizes as size = (-1,-1) or size = (-1,22) if you want that height fixed.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


an0malaus posted Sat, 22 June 2019 at 2:23 AM

Hi Karina, you'd also left out adding the StaticText st2 to the vbox sizer, so it was overlayed with the st1 and button layout.

Here's a screenshot of the minimal changes I made (new left, original right) Screen Shot 2019-06-22 at 5.18.27 pm.png and here's what it looks like on macOS: Screen Shot 2019-06-22 at 5.20.10 pm.png compared to the original:

Screen Shot 2019-06-22 at 5.22.19 pm.png

I hope that's what you were after.

Cheers, an0malaus



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


adzan posted Sat, 22 June 2019 at 2:26 AM

gwhicks posted at 2:25AM Sat, 22 June 2019 - #4354056

In return, I need someone to remind me how to create a signature for my posts. It's presumably called something else in my profile, but not signature...

Hi. Left Mouse Click or Tap on you profile picture (top right of the Renderosity site, next to the cart icon).

Click on Settings.

Public Profile page will open, look above that, were it says My Settings and mouse click on - Forums.

Forums Option page will open and you can Set up your Signature.

Click the Save Changes button when finished.



KarinaKiev posted Sat, 22 June 2019 at 3:39 AM

gwhicks posted at 3:34AM Sat, 22 June 2019 - #4354059

Hi Karina, you'd also left out adding the StaticText st2 to the vbox sizer, so it was overlayed with the st1 and button layout.

...

and here's what it looks like on macOS: Screen Shot 2019-06-22 at 5.20.10 pm.png ... I hope that's what you were after.

Cheers, an0malaus

Thank you @Cage & gwhicks!

That's EXACTLY what I needed. SASHA can be released this evening :)

K


randym77 posted Sat, 22 June 2019 at 7:59 AM

KarinaKiev posted at 7:57AM Sat, 22 June 2019 - #4354065

gwhicks posted at 3:34AM Sat, 22 June 2019 - #4354059

Hi Karina, you'd also left out adding the StaticText st2 to the vbox sizer, so it was overlayed with the st1 and button layout.

...

and here's what it looks like on macOS: Screen Shot 2019-06-22 at 5.20.10 pm.png ... I hope that's what you were after.

Cheers, an0malaus

Thank you @Cage & gwhicks!

That's EXACTLY what I needed. SASHA can be released this evening :)

Woo-hoo! Lots of Poser happenings this week.

Looking forward to this. I was unable to install the old version of Sasha (some kind of error) and when I heard a new version was coming, decided to wait rather than wrestle with whatever the problem was.


Miss B posted Sat, 22 June 2019 at 11:54 AM

KarinaKiev posted at 12:53PM Sat, 22 June 2019 - #4354065

That's EXACTLY what I needed. SASHA can be released this evening :)

K

YAY!!! 😁

_______________

OK . . . Where's my chocolate?

Butterfly Dezignz


rokket posted Sat, 22 June 2019 at 1:19 PM

I am going to check for her now!!!!!!!!!!!!!

If I had a nickle for ever time a woman told me to get lost, I could buy Manhattan.


an0malaus posted Sun, 23 June 2019 at 9:02 AM

adzan posted at 11:50PM Sun, 23 June 2019 - #4354060

gwhicks posted at 2:25AM Sat, 22 June 2019 - #4354056

In return, I need someone to remind me how to create a signature for my posts. It's presumably called something else in my profile, but not signature...

Hi. Left Mouse Click or Tap on you profile picture (top right of the Renderosity site, next to the cart icon).

Click on Settings.

Public Profile page will open, look above that, were it says My Settings and mouse click on - Forums.

Forums Option page will open and you can Set up your Signature.

Click the Save Changes button when finished.

Thanks adzan, I did find that eventually. I was just hoping that there were ANY FAQ pages that would answer those questions without having to ask for help. But, that's what communities are for. ?



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


SamTherapy posted Mon, 24 June 2019 at 10:46 AM

No working links for Sasha, AFAICT.

Coppula eam se non posit acceptera jocularum.

My Store

My Gallery


knyghtmare2021 posted Mon, 24 June 2019 at 10:49 AM

There is a download link on the site, but it just opens a .png image right now....


an0malaus posted Mon, 24 June 2019 at 11:01 AM

SamTherapy & knyghtmare2021 if you go to the download forum and open the single topic, hovering over the image now shows a link to dlFree.fr, which will actually let you download the file. I've just done it now. 25MB or so.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


an0malaus posted Mon, 24 June 2019 at 11:07 AM

Whoops, KarinaKiev must be actively updating the site as I type this. The image which used to be in the Download post is now gone and a visible link is in its place. Still, downloads appear to be working now.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


SamTherapy posted Mon, 24 June 2019 at 2:35 PM

Got it, thank you!

Coppula eam se non posit acceptera jocularum.

My Store

My Gallery