472,333 Members | 2,602 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

PyGUI - Couple of questions - TextField callbacks and drop downlist....

The PyGUI website specified this place as the place for general
discussion about it, so here goes....

First off - thanks for something that is so straightforward to get
running on OSX... I've been migrating some relatively straight-forward
scripts-with-GUIs from Linux to OSX, and, while I used FLTK on Linux,
I could not get pyfltk to install on OSX. PyGUI was so
straightforward, though. Made me a very happy bunny.

Fortunately, I wrote most of the pyfltk-specific code in a helper
module, so I got that transferred over to PyGUI easily enough. But
there were a few things that I ran up against....

So... A couple of questions for you all...

TextField callbacks... I want to be able to generate a callback when a
textfield is modified. The text field has to only allow a very
specific format in it, and in fltk, I'd just have the callback be a
validation function which would either reset it to the old value or
allow the current one. It doesn't appear to have an "action" member...
Is there anything I can do here? Or should I maybe subclass the
TextField class.....

Drop-down lists... There's a menu, but, apparently, no drop-down list
class. For now, I've replaced it with a RadioGroup, which is okay, for
now, as I know that there aren't going to be any more than 3 items,
but I can see situations where I'd really rather have a drop-down list
a part of the GUI, rather than in the menu at the top of the screen.

Anyway, any advice on this would be much appreciated! For the kind of
thing that I'm doing, it's very appreciated that there's something
that's very straightforward to install.
Hugh Macdonald
Oct 20 '08 #1
2 1671
Hugh wrote:
TextField callbacks... I want to be able to generate a callback when a
textfield is modified. It doesn't appear to have an "action" member...
I haven't got around to adding any actions to text fields
yet.

In the meantime, you could put a key_down method on the
containing window that catches the Return or Enter key.
Is there anything I can do here? Or should I maybe subclass the
TextField class.....
Unfortunately that's not easy to do at the moment. Due to
disparities in the way events are handled by the underlying
toolkits, PyGUI doesn't promise to let you intercept events
on the built-in control types by overriding methods.

I really need to rethink the whole event handling stragegy,
as it's rather a mess at the moment.
Drop-down lists...
That's another thing for the future. If you're feeling
adventurous, you could have a go at rolling your own based
on a View.

Anyway, glad you're finding it useful. Feel free to ask if
you have any more questions.

--
Greg
Oct 21 '08 #2
On Oct 21, 2:46*am, greg <g...@cosc.canterbury.ac.nzwrote:
Hugh wrote:
TextField callbacks... I want to be able to generate a callback when a
textfield is modified. It doesn't appear to have an "action" member...

I haven't got around to adding any actions to text fields
yet.

In the meantime, you could put a key_down method on the
containing window that catches the Return or Enter key.
Thanks - I think, for now, I'll probably just go with popping up an
Alert when the main window's "Launch" button is pressed... I'm a
little time-constrained on this project, but I'll maybe look into
getting it working more like I'm after at a later date...
Drop-down lists...

That's another thing for the future. If you're feeling
adventurous, you could have a go at rolling your own based
on a View.
Again, time constraints mean that I'll probably stick with the radio
buttons that I've got at the moment - they work quite well in this
situation - my query here was more of a general thing.
Anyway, glad you're finding it useful. Feel free to ask if
you have any more questions.
Thanks. Will definitely do this. It didn't take me very long at all to
transition over this GUI from pyfltk to PyGUI, which is definitely a
good sign...!
Hugh
Oct 21 '08 #3

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

Similar topics

108
by: Zooko O'Whielacronx | last post by:
I'm a fan of Greg Ewing's PyGUI . I used it to code a simple game for my son , and enjoyed it. Programming with wxPython feels like programming...
0
by: Marc Christiansen | last post by:
Hi! After some installation problems related to PyGUI (well, indirectly -- I had to install new versions of: freetype, fontconfig, xft2 (from...
2
by: Tom Gao | last post by:
hi guys I'm wondering how do I pass a key-value pair to a drop downlist ? since I can not use hashtable as there is nor order.. and I can not use...
7
by: Markus McGee | last post by:
Hi all, I have a quick question...I believe. On my web page, call it page A, I have a drop downlist with runat server enabled. When the drop...
4
by: Rudy | last post by:
Hello! I have 4 diffrent drop downlist. I want a user to select a value from a drop down list, and place it in a SELECT statement. How would I...
3
by: greg | last post by:
A small problem has come to light with PyGUI 1.6 on MacOSX systems. If you get the following exception: File...
3
by: Yi Chen | last post by:
We have a drop down list on a PHP page, with several product names, and when people click one item, we will refresh the same page with the product...
2
by: myquestion | last post by:
how to hide/show a text box using drop downlist in php
1
by: casybay | last post by:
Hi all, I am writing a Java GUI for my c like program. The GUI allows a user to select a txt file a time from local. The content of the file...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...

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.