Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > event binding and component.config

Reply
Thread Tools

event binding and component.config

 
 
Scott Holmes
Guest
Posts: n/a
 
      08-16-2003
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


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
---------------------------------------------------------------------


 
Reply With Quote
 
 
 
 
Greg McFarlane
Guest
Posts: n/a
 
      08-27-2003
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 <> wrote in message news:<mailman.1061059285.7748.python->...
> 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
>
>
> 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
> ---------------------------------------------------------------------

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView binding - how to stop initial binding Amit ASP .Net 6 10-24-2006 08:06 AM
pywin32 COM sort in Excel (late binding fails, early binding works) (+py2exe) kogrover@gmail.com Python 2 10-20-2006 04:08 PM
Complex data binding question, binding child objects of a custom collection. JcFx ASP .Net Datagrid Control 0 06-01-2005 04:01 PM
Data Binding - using inline code vs. functions vs. straight binding Jordan ASP .Net 2 02-10-2004 08:32 PM
value binding and function binding Vivek Nallur Ruby 0 09-25-2003 02:52 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57