Buttons are not added in the string

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Buttons are not added in the string

himanshu
I am trying to link my sqlite database with wxpython GUI.i use for loop to add buttons in the grid , and i want to label the buttons also. So  when i do that it is printing all the button labels in the terminal and not making grid at all.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

gui.py (7K) Download Attachment
ELEMENT.py (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Buttons are not added in the string

Tim Roberts
Himanshu Pareek wrote:
> I am trying to link my sqlite database with wxpython GUI.i use for
> loop to add buttons in the grid , and i want to label the buttons
> also. So  when i do that it is printing all the button labels in the
> terminal and not making grid at all.

I'm confused about what you're trying to accomplish here.  You haven't
actually added a button into the grid.  You have simply added a custom
renderer that draws the same stuff that a button would draw.
wx.RendererNative.Get().DrawPushButton does the drawing that a button
would do, but it doesn't actually create a button.  If you want a label
drawn, you have to pass the label into DrawPushButton.  You aren't doing
that right now.

I see "clicked" in the log when I run your example.  I don't know what
you mean by "not making grid at all".

You haven't explained your app, but you might think about whether a
GridBadSizer would be better suited to your task than a grid with a lot
of customization.

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Buttons are not added in the string

himanshu
I have used boxsizer and getlabeltext to print the name of button
See my code https://github.com/svnitHIMANSHU/Raman-spectroscopy-database

Himanshu pareek
Applied physics Department
Sardar Vallabhbhai National Institute of Technology, Surat.
Contact No.- 8437385593



On 13 June 2017 at 22:11, Tim Roberts <[hidden email]> wrote:
Himanshu Pareek wrote:
> I am trying to link my sqlite database with wxpython GUI.i use for
> loop to add buttons in the grid , and i want to label the buttons
> also. So  when i do that it is printing all the button labels in the
> terminal and not making grid at all.

I'm confused about what you're trying to accomplish here.  You haven't
actually added a button into the grid.  You have simply added a custom
renderer that draws the same stuff that a button would draw.
wx.RendererNative.Get().DrawPushButton does the drawing that a button
would do, but it doesn't actually create a button.  If you want a label
drawn, you have to pass the label into DrawPushButton.  You aren't doing
that right now.

I see "clicked" in the log when I run your example.  I don't know what
you mean by "not making grid at all".

You haven't explained your app, but you might think about whether a
GridBadSizer would be better suited to your task than a grid with a lot
of customization.

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to a topic in the Google Groups "wxPython-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/ztHYl2jIe04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Buttons are not added in the string

Tim Roberts
Himanshu Pareek wrote:
> I have used boxsizer and getlabeltext to print the name of button
> See my code https://github.com/svnitHIMANSHU/Raman-spectroscopy-database

That code contains no grids and no buttons.

You are making more than 200 separate queries to your database.  It
would be much smarter to make one query and process the rows and columns
as you receive them:
    cursor = self.conn.execute( "SELECT * FROM element ORDER BY row_no,
col_no;" )
    for element in cursor.fetchall():
        # ...

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.