Buttons on wx.Dialog subclass

Hi, everyone. I wanted to make my wx.Frame subclass modal, so I changed its
inheritance so that my new class would inherit from wx.Dialog instead.
However, the buttons are not being displayed (I'll only post the __init__
method, because I don't think the others are necessary at this topic):

class ChooseNumberForPatientsWithSameNameDialog( wx.Dialog ):
    def __init__( self, parent, name ):
        global cursor, numberChosen
        wx.Dialog.__init__( self, parent = parent, id = -1, title =
'Escolher paciente de acordo com os dados cadastrados',
            size = ( 500, 410 ), style = wx.DEFAULT_FRAME_STYLE ^ (
wx.RESIZE_BORDER | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX ) )
        self.name = name
        #Centers this ChooseNumberForPatientsWithSameNameFrame:
        self.Center()
        #Creates panel as a child of this
ChooseNumberForPatientsWithSameNameFrame:
        self.panel = wx.Panel( parent = self )
        #Output string:
        output = u'Mais de um paciente foi encontrado com o nome
inserido.\nPor favor digite o número do(a) paciente desejado, de acordo com
os dados cadastrados:\n\n'
        #Labels:
        self.instructionsLabel = wx.StaticText( self.panel, -1, output, pos
= ( 10, 10 ) )
        self.numberLabel = wx.StaticText( self.panel, -1, u'Número
escolhido:', pos = ( 110, 310 ) )
        #Field:
        self.numberField = wx.TextCtrl( self.panel, -1, '', pos = ( 218, 307
) )
        #Buttons:
        self.confirmButton = wx.Button( self.panel, label = 'Finalizar', pos
= ( 90, 148 ), size = ( 100, 25 ) )
        self.cancelButton = wx.Button( self.panel, label = 'Cancelar', pos =
( 194, 148 ), size = ( 100, 25 ) )
        #SQLite query:
        results = cursor.execute( 'select * from Paciente where Nome = "' +
name + '"' )
        results = results.fetchall()
        length = len( results )
        counter = 1
        #Updates the output:
        output = u''
        for result in results:
            output += 'Nome: ' + unicode( result[ 1 ], 'utf-8' ) +
u'\nNúmero: ' + str( result[ 0 ] ) + '\nIdade: ' + str( result[ 2 ] ) \
                + u'\nEndereço: ' + unicode( result[ 3 ], 'utf-8' ) +
'\nTelefone 1: ' + result[ 4 ] + '\nTelefone 2: ' + result[ 5 ] + \
                    '\nE-mail: ' + result[ 6 ]
            if counter != length:
                output += '\n\n'
            counter += 1
        #Main subwindow:
        self.mainTextSubWindow = wx.TextCtrl( self.panel, -1, output, pos =
( 8, 75 ), size = ( 479, 200 ), style = wx.TE_MULTILINE )
        #Events binding:
        self.Bind( wx.EVT_BUTTON,
self.ValidateFieldAndUpdateNumberChosenIfPossible, self.confirmButton )
        self.Bind( wx.EVT_BUTTON, self.CancelNumberChoosing,
self.cancelButton )

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Buttons-on-wx-Dialog-subclass-tp5721263.html
Sent from the wxPython-users mailing list archive at Nabble.com.

For some reason, the buttons are appearing, but not in the position specified
in the code.

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Buttons-on-wx-Dialog-subclass-tp5721263p5721265.html
Sent from the wxPython-users mailing list archive at Nabble.com.

I'll use another technique, thanks everyone.

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Buttons-on-wx-Dialog-subclass-tp5721263p5721267.html
Sent from the wxPython-users mailing list archive at Nabble.com.

For some reason, the buttons are appearing, but not in the position
specified
in the code.

well, you really want to be using sizers, rather than absolute positioning
anyway.

Get familiar with them, you'll be glad you did.

-Chris

···

On Wed, Jun 11, 2014 at 1:16 PM, stdq <fernando.karpinski@gmail.com> wrote:

--
View this message in context:
http://wxpython-users.1045709.n5.nabble.com/Buttons-on-wx-Dialog-subclass-tp5721263p5721265.html
Sent from the wxPython-users mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

I agree that sizers should be used instead of absolute positioning. I learned the hard way that a gui may not display correctly even if the smallest of settings, like font, get changed on a computer. With sizers at least the positioning can adjust to account for system settings a little easier. Just my 2 cents.

-Mike S