Have a look at wex.pl on http://www.fairymails.com/perl/
http://www.fairymails.com/perl/
There is some (very rudimentary) syntax highlighting done in a simple
Richedit. No extras needed for that to work.
-Original Message-
From: moo cow [mailto:[EMAIL PROTECTED]
Sent: Monday, September
sub OKbutton_Click { .. gather data and return (-1); }
When you return -1 in any event sub, not just in _Terminate, your window
gets destroyed. Since you cannot exit the Dialog() loop other than with -1,
there are but two ways to do it
a) do the error checking inside an event (namely OK_Click).
I never worked with accelerators, so this may be stupid, but did you connect
the accel table to the listview? If so, can you try to hang it on the main
window instead?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 06, 2002 20:19
To: ROB
Cc:
This is a common newbie error (xqsme), I think there are even some of the
samples where this happened:
ALL Win32-GUI objects (window, widgets, timers, everything) need a -name
option and usually this must be a unique name.
Change
$main-AddLabel(-text = Hello, world);
to
$main-AddLabel(-name =
I use it to get some more mouse-related events. The most useful class for
that is the RichEdit class.
new Win32::GUI::Class
(
-name = 'PoorEdit',
-widget = 'RichEdit',
-extends = 'RichEdit',
);
$Main-AddRichEdit(
-name = Rich,
-class = PoorEdit,
...
I'm assuming you want to get the contents of a text field, not text file ...
;-)
There is the Text() method, defined as a general function, i.e. should be
valid for all widgets. It returns all of a field's contents. If you want the
bit that's selected:
($from, $to) = $Main-MyField-Selection()
This is not a question, I just wanted to share a solution. When you have a
treeview with a lot of entries (a hundred base nodes with dozens of branches
each) and do a $Main-Tree-Clear (), this can clog up the CPU for a
considerable time. Here's what's much faster (up to 100 times, depending on
the
OK, this is killing me. I need help from someone with GUI.xs eyes ... Aldo?
In a very busy loop, I keep calling
return -1 if Win32::GUI::DoEvents () 0;
To be able to click and have the program react (especially to Abort_Click or
Alt+F4)
Every once in a blue moon, I get the infamous the
Well ... I just tried it. I replaced my
/pleasedonotcrash/;
before the DoEvents() call with
Win32::GUI::PeekMessage (0, 0, 0);
and guess what ... it crashes.
Like I said, there IS a bug in the xs somewhere and when the circumstances
are right (nah ... wrong!) then it will crash the script and
Yep, that works fine. ${something} is the same as $something, except that
the {} seperates the variable name something from whatever follows. Both
your solutions do the same. That's the beauty and curse of Perl, there are
always 1001 ways to do it.
-Original Message-
From: Ceres
Fist bit of -style docu:
DON'T USE -style AT ALL!!!
Use -addstyle and -substyle instead. That avoids missing a few default
flags.
Apart from that, I'm afraid, you will have to dig dep into the header
files or other, filthy windows documentation for what bits can be used with
which widget.
$TV-FirstVisible($firstnode); # does not work
$TV-Select($firstnode, 5); # does not work
That's odd - I do $Main-Tree-Select($node) in my code and it sure works.
What are you trying to do with that second parameter, the 5? Could it be
that you have warnings off and the select never gets called
try
sub Main_Resize {return 0;}
That is supposed to cancel the default behavior of the resize function.
Well, that's what it says on the box ;-) If it doesn't work, try
$resizing = 0;
sub Main_Resize
{
unless ($resizing++)
{
$Main-Change (-size = [800, 574]);}
You need a -name = 'something' option in *every* widget.
The name does not need to be unique, if you don't have to access the widget
later, but it *must* be specified. V 0.0.558 crashes on a widget without
-name, other versions don't.
In short, in the header files of a C-compiler installation.
C:\Program Files\Microsoft Visual Studio\VC98\Include
for VS6.
In even shorter, on MSDN.
The WS_ flags are covered in
Platform SDK Documentation
- User Interface Services
- Windows User Interface
- Windowing
sticky mainly refers to which sides the widgets should stick to when
resized. so if i have a listview which is -sticky = 'ew'
then when it gets
resized it should stretch to fit across the screen (as in
east and west,
left and right) but the vertical size would stay relative to
how much
-Original Message-
From: Timothy Johnson [mailto:[EMAIL PROTECTED]
Subject: RE: [perl-win32-gui-users] Newbie to GUI -- Busy Window?
BTW, if you want to install 0.0.665, just extract the files
from the tarball
that comes with the .ppd file. In it is a blib folder. You
should
hi i need lots of help. i'm fairly new to perl and i only compiled
win32::gui yesterday. i have a listview that i'd like to
Don't worry, we've all been fairly new. With most of the stuff, most of us
still are.
my($stuff) = @_;
sort $a = $b, $stuff;
This looks like a Perl problem rather than
Dude ... you call settings from an event handler and $Window2-Dialog();
from settings. That's asking for trouble. Define all your windows and
widgets somewhere. Then call
Win32::GUI::Dialog();
once and only once from the main thread. There has been a recent posting on
how to handle more than one
You must not return -1 from mySearchDialog_Terminate, because it destroys
and releases all the objects associated with it. You want to reuse the
DialogWindow, so just Hide() it and return One. That does not exit your
Dialog() call, but that's not needed. If you want to make the Dialog modal,
you
I know that previous versions of GUI were fault-tolerant towards missing
-name parameters, which 558 is NOT. Make sure that all your objects (not
only widgets, also windows and labels!) have a unique -name. Non-unique
-names won't cause crashes, you just can't access any of the redefined
objects.
On the other hand, I fear that none of that will allow me to
add scroll
bars to the bitmap, so that I can display a portion of a bigger than
screen image.
You could add scroll bars and then reposition the image. The scroll bars
don't have to be tied to the label within Win32::GUI, you just
Failure-- Seems like ImageMagick accidentally inverts the color when
converting from .tif to .bmp ... and that ImageMagick's
Negate operation
doesn't have any effect on .bmp files !!!
Failure-- there seems to be no way to control the colors: white turns
out grey. Lots of -foreground and
I knew we had this before ... here's what I found out then:
-Original Message-
From: Piske, Harald
Sent: Friday, November 16, 2001 02:43
To: Win32-GUI-Mailing List (E-mail)
Subject: RE: [perl-win32-gui-users] Win32::DialogBox - LostFocus() Event
i n Button and RadioButton Objects doesn't
Guys ... it's Christmas :-) This group has always been a tremendous source
for solutions. I understand there is a solution to the problem that was
posted. I fail to see the point in going back and forth about what might
have been a better idea some time ago. Win32::GUI is an invaluable piece of
I don't know for sure if that's the reason, but I remember Aldo warning
about using the style option, because you inadvertently remove, or leave
out, styles that may be important. Try using -addstyle to add styles and
-remstyle to remove styles. That will leave all the standard style flags
Guys,
seems nobody remembers how we did it about a year ago, so this is the way:
download the ppm file with a regular browser to your hard drive. I don't
remember where I got it (that's why I did not post this before), it was some
unpublished path on either dada.it or sorceforge, but I still have
The GUI FAQ ( http://www.jeb.ca/faq/Win32-GUI-FAQ.html
http://www.jeb.ca/faq/Win32-GUI-FAQ.html ... praise, praise) points to
ftp://ftp.wh.whoi.edu/pub/gb109.zip ftp://ftp.wh.whoi.edu/pub/gb109.zip
for the GUI Builder. I dunno if that link still worx or if there has ever
been a newer version.
Try using a _Timer instead of the while loop.
Wa to much effort, although it would be the correct way to handle
this. If you just put a Win32::GUI::DoEvents() inside your loop, the user
can click around and events get fired while the script is running.
HOWEVER, bear in mind that the event
The LostFocus() event doesn't respond at all when a mouse click
happens on another object (button, textfield, etc.)
From what I can see in the xs code, the button class is treated in a
different manner. You might want to try
Button_Anonymous {print join (', ', @_), '\n';}
This is an event
If fork is before show window,then window wont initailise
untill forked sub exits.
I vaguely remember that fork() does a subroutine call and does not actually
launch another task. If you use backtick instead (as in `runme.exe
/option=param` or rather `perl.exe yetanotherscript.pl`), your
Still got one problem,
my $messref [EMAIL PROTECTED];
$result=$Win1-PeekMessage(0,0,@$messref);
Should fill @message with the message details.
like getmessage does,
...
but it dont, any suggestion ?
I suggest there is a bug in the xs. I have come
Actually, there seems to be an easier way.
$Window-{-dialogui} = 1;
Taken from a recent posting.
We have a silent agreement here on this list not to blame or flame anyone
for re-posting questions that have been answered, since we know searching
the archives does not work ... right, guys? Erm,
The multi will accept Ctrl+Tab as tab, dunno 'bout Ctrl+Return, presumably
ditto. If that's not what you want, consider intercepting keys - either tab
and return only in the multi field, which might not work, or tab and return
for the non-dialogui-window, doing the focus-shifting yourself, which
I triede for eg. the DblClick() event like that
sub Button_DblClick {
print DblClick on Button.\n;
return 1;
}
But this doesn't work ... are this events not supportet yet?
Yes they are, thru the class. Note that you can have buttons extend the
RichEdit widget and vice versa, which
excerpt
Agreed... it isn't all that bad, but it is limiting/frustrating
nonetheless...
especially given how simple it would be to add this functionality (i.e. the
widget
ref must be available inside of the widget code itself, deep in the guts of
Win32GUI, and thus be available to the code making
Why then, I wonder, does it not show the selection if you do a
$Window-ListBox-SetFocus() or even
$Window-ListBox-SelectedItem-SetFocus() ? I tried both
with a sub of
Window_GotFocus and Window_Restore.
Just a thought, I did not try: if you change the selection to what it
already is or even
Is there any plans to support more event types? E.g.
keyboard events. Then
we might handle the TAB in our callbacks for a Window. Not an ideal
solution. I'd rather use events for more creative stuff.
a) there are plans to come up with a whole new, extensible event model.
We're all
my $ss = pack(,5,0,0,0, 0,0,0,0, 0,0,0,0);
GUI::SendMessage($window, $EM_GETLINE, 0, $ss); # this does not
My guess is that you pass the SendMessage function a copy of $ss, or the
contents of $ss, to be precise, so that whatever gets put in there will not
make it back to $ss.
No luck so far, I've tried everyones various suggestions. AFAIK, you
can use hexadecimal or decimals for colours.
Three suggestions:
1) If you create a label the size of your window as the very first control,
you can use it's background color to fill the window.
$Main-AddLabel
(
-name
This is probably a simple one, but I can't find out how to wrap text,
for example the text property for a Radiobutton.
I tried with a Perlish carriage return+newline such as bla \r\n more
bla, which did not work. What code do you use?
I dunno if this comes down to the same side-effect or has
Everytime I write a new program I always make
some stupid mistake that screws everything up.
Hm ... anybody here that this does NOT happen to?? I mean of those people
that really DO write programs and not recombine samples with cutpaste, the
way of Lego-programming you do VB and Dotnet and
This is how I intercept xxx_Terminate, which I do to write something to the
registry when the program exits. For the whole picture, see WinSize.pm @
www.fairymails.com/perl/ http://www.fairymails.com/perl/
# must bottle this up inside eval
eval qq
(
# get pointer to current sub.
I didn't do this or test this, just an idea: if you fork into another,
totally independent script that uses GUI, then the Dialog() call from there
should not trigger event subs in your first script. Then all you need is to
hang in one event sub of your first script until the second one comes back.
Tried your code snippet and it works fine. Maybe there's something wrong
with one of your event subs? Or your general installation? What windows,
perl (perl -v) and GUI (ppm query) versions are you using? Check your own
code in a script that does nothing else (see below) and see if it does the
Sorry if this appears twice - I posted it yesterday and got a delivery
warning. Since it hasn't showed up yet and other postings seem to get thru,
I try again:
---
Basically, what you want is
Win32::GUI::SetCursor ()
the tricky thing is to get the standard resource of
Basically, what you want is
Win32::GUI::SetCursor ()
the tricky thing is to get the standard resource of the hourglass. Feel free
to use my perl module http://www.fairymails.com/perl/WinStRes.pm for exactly
this:
Win32::GUI::SetCursor (WinCursor (WAIT)); # hourglass ...
There is a SetCharFormat method to the RichEdit control.
$Rich-Select ($from_here, $to_there);
$Rich-SetCharFormat (-color = $flashy_pink)
Look up http://www.jeb.ca/ for tons of information and knowledge (-
Win32-GUI - FAQ), also contains links to Aldo's
The infamous 0.99 build ...
Go to either Activestate or dada.perl.it and find the latest version. Sadly,
the version number 0.99 looks newer to the Activestate ppm installer than
the current version 0.0.558, so it will refuse to update it. Instead, do
- ppm remove Win32-GUI
- ppm install
I don't quite see where your problem is ... do you want to know HOW to
update your window or WHEN?
As for the how, your $sb-Text(whatever); should work fine anytime. As for
the when, maybe you are looking for a timer so that you can update the
status bar every other second or so.
No offence, but
I guess there's just no way to do it so that all browsers behave the same.
And you would not want to have code for all the major browsers out there -
talk about maintainability.
How about making your code smart enough to deal with it? Open a new browser,
deliberately empty, i.e. w/o passing a
Aren't you gonna give that thing a -name? Every object in GUI needs a name.
If it's not unique, that's fine so long as you don't need to interact with
the thing. But popping out of Perl from unnamed objects, we've seen that
before here on the list.
Have fun,
Harald
-Original Message-
FirstVisibleItem takes an Index, not a string. The Index is zero-based, as
Dave said. The points are
a) if you want a specific entry to be selected by default, so that the user
can change is if she wants and leave it if she doesn't, then you want
$LB-Select(), not FirstVisibleItem.
b) use
Try this:
use Win32::TieRegistry;
$http = $Registry-{Classes\\http\\shell\\open\\command}-{'\\'};
`$http $url`;
I did not try with other browsers, though, just Micro$tuff.
Have fun,
Harald
-Original Message-
From: Morbus Iff [mailto:[EMAIL PROTECTED]
Sent: Donnerstag, 31. Mai 2001
Well, then you just take the best of both ... first, you open a new browser
window and then you do what you did before. I pretty sure that the
ShellExecute will target this new browser. At least, when I click a link in
a mail in this rotten !#^%$Outlook, it does the very same ^%!# thing of
Actually, Morbus' approach is the better choice, if you don't mind my saying
so. While simply getting the text and setting the appended text basically
works (btw: even $RE-{-text} .= $newText; would do), what happens is that
the whole field gets refilled and redrawn, using a lot of resources for
More general ... hm. What do you mean? All the topmost windows? I think the
problem is too varied for a general solution. If you don't know the class
names of the windows you want to find the coordinates of, how do you know
which ones to choose? Well, you might go and take all the windows that are
I copied your code into a script of mine and it worked. Please make sure you
have Win32-GUI 0.0.558 (in a dos window, run ppm query win32-gui).
As for your approach, I would recommend you create the dialogbox and all
it's controls outside the sub stored_Click, before you call
Win32::GUI::Dialog()
$_ = Win32::GUI::FindWindow (Shell_TrayWnd, );
@_ = Win32::GUI::GetWindowRect ($_);
$width = $_[2] - $_[0];
$height = $_[3] - $_[1];
tested on Win2k and Win98. Interestingly, the position of the taskbar is
slightly off the screen (-2).
Note that the taskbar can be moved to each of the four
| Is there a MouseOver function for Buttons? I didn't see
| anything in the docs.
When you create a Button-class you'll get the MouseMove event. Other than a
real MouseOver, this fires every time the mouse moves. It would take some
fantasy to come up with MouseEnter and MouseLeave. One way would
Hi Michael
First off, you might want to upgrade to Win32::GUI 0.0.558. The 502 is
really outdated.
In short, Aldo has cautioned (on this list) a few times to beware of the
-style option because its use makes you prone to omitting standard flags for
the particular control, thus inadvertently
Never had that at all, and I love to keep my taskbar stuffed with around 15
open apps, 10 of which are min'd while I deal with 3 of the other 5. Even on
mon mornings, after around 64 hrs of win-dozing, they come up normally ...
that is, as painfully slow as is usual for this OS ;-)
There must be
I can confirm the behavior, but the real problem is a bug in the script, not
in GUI:
*EVERY* GUI object needs a unique name. Add -name = options to both the
statusbar and the progressbar below it and the script starts up.
| -Original Message-
| From: Bullock, Howard A. [mailto:[EMAIL
| Dammit, I don't know what my problem is then.
OK, I tracked it down - I'm using Windoze 2000, you are on 98.
The workaround is:
$logbox-SendMessage (0x115, 7, 0); # scroll to bottom
$logbox-SendMessage (0x115, 2, 0); # scroll one page up
In your case, where you only ever display
| Good day.
Sure - it's a friday! Thank you.
| To my disappoint, the image didn't display.
That is more than strange. Say, you should make sure you have the latest
Win32-GUI version. When you do ppm query from a DOS prompt, it should say
0.0.558 and NOT 0.99, which has been around for a while.
|
I don't know if that's the reason for your going batty, but your $logbox
control doesn't have a name. That's a big no-no. You call DoEvents for the
first time and GUI doesn't know where to mail the Resize or Show events.
Maybe that's what causes it to screech, maybe not.
Have fun,
Harald
|
| If anyone knows how to get a Window to not be
| displayed in the taskbar, please let me know.
I did not try it, but if I'm not mistaken, only top level windows (ie,
desktop children) appear in the taskbar. If you manage to create a window as
a child to your main window, it might solve a
| is there a way for it to listen while it downloads for the
| cancel event?
Your sub Cancel_Click should NOT exit, however, the exit statement is never
reached due to the return.
Return -1 is correct, this is how you tell the GUI to end the message loop.
Now the message loop exits back into your
| time returns back to my program.The window created by my
| program is
| not refreshed immediately to the state before switching but I must
| wait until my program writes to that window.
|
| The Window class has the Activate() event. Maybe some other
| control has
| something similar that you
What is the best way how to refresh the window and show users
that the program is still running? Thank you for any good idea.
introduce Win32::GUI::DoEvents() from time to time.
look at RE: [perl-win32-gui-users] Looping Question for an implementation
sample.
Erick,
About the (numerous) [TBD]s in the doku - at least the one I have.
I was wondering if it was a good idea to just point to the dokus on the
msdn. For instance, I wanted to set up an ImageList and needed to know what
to put in the FLAG parameter. It took me a couple of minutes to locate the
Hi Jonathan.
I found a way - not exactly easy, probably far from perfect, but it works. I
hide all windows - walking backwards through the chain of desktop children,
to avoid making each active just before hiding it. Then I cover the
background with a big, fat, ugly, black rectangle and show my
| Win32::GUI? I have several sleeps in my loop and I want the
| rest of the gui
| script to be accessible while this part is asleep. Any suggestions?
Hi Thomas
The basic knack is
Win32::GUI::DoEvents() while Win32::GUI::PeekMessage(0,0,0);
You can call this even from inside an event. Here's a
I back this motion. There are countless programmers out there who keep
looking for useful code but would not step forward to ask for it (eg on a
list like this). Trust me - I used to be one of them. I spent days writing a
tiff to bmp converter because I could not find what half a dozen others must
One more thing ... I just remembered an issue with the Win32::GUI Version
you get from Activestate being outdated (ref. sequence
[perl-win32-gui-users] Bug in Textfield scrolling)
When you do ppm query Win32-GUI and it gives you version 0.99, dump it (ppm
remove Win32-GUI) and get the current
| Hirosi Taguti wrote:
[...]
| This -topmost option cann't be changed after creation?
[...]
| no, it doesn't work (yet); changing -topmost requires an
| additional bit of code that I wasn't afare of until recently :-)
[...]
| Aldo
This may be a stupid idea and I admit I did not test it:
you
All I want is, When the progran start's the first textbox is already
highlighted and to submit it all I have to do is press Enter,
I haven't done it, just read about it, so forgive me if I write something
stupid (I would anyway).
From my understanding you have to go through the process of
Hi all,
I know I'm getting naggy with things that no one ever comes across. This
time it's hiding select objects with $main-buggything-Hide(). When I bring
one back with Show() I need it to be on top, so I do
$main-buggything-BringWindowToTop(). Here's the catch:
- I only ever come on top of
I made a paint sub that uses some drawing functions. It makes a beautiful
picture in Win2000, but on the target machine, running Win98, nothing shows.
Rectangle seems to work fine, Circle behaves strangely and Arc does not work
at all. Any ideas?
### code snippet:
sub Paint
{
$pitch =
When I use $Mainwindow-Thisbutton-ChangeCursor ($fancyicon) then the mouse
cursor changes to the new resource whenever the mouse is positioned over ANY
button on the window. Seems the ChangeCursor affects the class and not the
object ...? Lacking MouseEnter and MouseLeave, how do I make ONE button
80 matches
Mail list logo