473,383 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

event binding and component.config

I'm experiencing what seems to be strange behaviour. I don't know if
it's Pmw, Tkinter on Python. I have a button, defined in a
Pmw.buttonbox, that I would like to configure to "sunken" after it has
been clicked/released. Using the example style coding:

self.buttonBox1.add('Add', command = self.addCalendar)

the button remains "sunken". If I bind the event:

self.buttonBox1.add('Add')
self.buttonBox1.component('Add').bind('<ButtonRele ase-1>',
self.addCalendarBind)
self.buttonBox1.component('Add').bind('<KeyRelease-Return>',
self.addCalendarBind)

the button reverts to "raised". The addCalendar and addCalendarBind are
still essentially stub functions:

def addCalendarBind(self,event):
self.addCalendar()

def addCalendar(self):
global prog_mode
self.clearCalendar()
prog_mode = 'add'
self.buttonBox1.component('Add').config(relief='su nken')
self.buttonBox1.component('Commit').config(relief= 'raised')
self.buttonBox1.component('Update').config(relief= 'flat')
self.buttonBox1.component('Delete').config(relief= 'flat')
self.buttonBox1.component('Query').config(relief=' flat')

--
---------------------------------------------------------------------
Scott Holmes http://sholmes.ws
http://pages.sbcglobal.net/scottholmes
sc*********@sbcglobal.net

Independent Programmer/Analyst Passport 4GL
PHP HTML Composer PostgreSQL Informix 4GL, SQL
---------------------------------------------------------------------
There are more things in heaven and earth, Horatio,
than are dreamt of in your philosophy
---------------------------------------------------------------------
Jul 18 '05 #1
1 1516
If you want something that allows a user to select a particular mode
and then to display that mode until it is changed - use
Pmw.RadioButton instead of trying to hack Pmw.ButtonBox. I think this
will do exactly what you want.

Greg

Scott Holmes <sc*********@sbcglobal.net> wrote in message news:<ma*********************************@python.o rg>...
I'm experiencing what seems to be strange behaviour. I don't know if
it's Pmw, Tkinter on Python. I have a button, defined in a
Pmw.buttonbox, that I would like to configure to "sunken" after it has
been clicked/released. Using the example style coding:

self.buttonBox1.add('Add', command = self.addCalendar)

the button remains "sunken". If I bind the event:

self.buttonBox1.add('Add')
self.buttonBox1.component('Add').bind('<ButtonRele ase-1>',
self.addCalendarBind)
self.buttonBox1.component('Add').bind('<KeyRelease-Return>',
self.addCalendarBind)

the button reverts to "raised". The addCalendar and addCalendarBind are
still essentially stub functions:

def addCalendarBind(self,event):
self.addCalendar()

def addCalendar(self):
global prog_mode
self.clearCalendar()
prog_mode = 'add'
self.buttonBox1.component('Add').config(relief='su nken')
self.buttonBox1.component('Commit').config(relief= 'raised')
self.buttonBox1.component('Update').config(relief= 'flat')
self.buttonBox1.component('Delete').config(relief= 'flat')
self.buttonBox1.component('Query').config(relief=' flat')

--
---------------------------------------------------------------------
Scott Holmes http://sholmes.ws
http://pages.sbcglobal.net/scottholmes
sc*********@sbcglobal.net

Independent Programmer/Analyst Passport 4GL
PHP HTML Composer PostgreSQL Informix 4GL, SQL
---------------------------------------------------------------------
There are more things in heaven and earth, Horatio,
than are dreamt of in your philosophy
---------------------------------------------------------------------

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Notlwonk | last post by:
Not sure where to post this Q I am trying to write a Managed Exchange Server Event Sink (as a class library) in C# I have been following this tutorial step-by-step ...
0
by: Henrik_the_boss | last post by:
Hello all. I have a couple of aspx pages. When something fails in them, I would like them to be able to log to either a database, a logfile, or the application log. All code is in C# I run...
9
by: Ollie | last post by:
okay sorry for cross posting but want to see if any one can explain the solution to this problem for me: I have a .Net ASP.Net app written in C# that use COM+ components to do some business...
0
by: Ian | last post by:
I have sub-classed the Page class in order to provide some base properties and methods that every page on my site will need access to. I would like to have these things show up in the Simple...
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
5
by: kimtherkelsen | last post by:
Hi, I have made some software that uses one of the COM ports to communicate with an external device. The software is written in C# and uses the new SerialPort class in .Net 2.0. It works...
7
by: Don | last post by:
Getting errors after following the MSDN article on using VB.NET (and VS2005) for "Implementing a Managed OnSave Event Sink" for Exchange Server 2007. Not sure, but part of the problem may be that...
7
by: Georg Grabler | last post by:
Hello everybody. There's a C library which i'd like to have python bindings for. I havn't known anything before about how to write python bindings for a C library. I succeeded now by using...
0
by: swellfr | last post by:
Hi, I have a component that i can only access through late binding. This is working fine , i can use all the exposed methods , but i can't register (/don't know how to ) event handlers for this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.