MALEADt wrote:
Hi all. I'm making my first programs with the win32::gui module, but I'm
experiencing some problems:

1) threads and win32gui?

Certainly possible, but there are some issues that you need to understand witht he current releases. If you haven't been pointed at it already, then I suggest that you take a look at the Win32::GUI::ThreadUtils package - available from http://www.robmay.me.uk/win32gui/

Until yesterday I was using activeperl's distribution (1.03), but after
updating to 1.05 I'm getting the following errors with my script:
        Free to wrong pool 1ceafb0 not 222828 at
C:/Perl/site/lib/Win32/GUI.pm line 294 during global destruction.

Sorry, can't help with that one without more detail.

I tried adding a piece of code a found somewhere:
        # make Win32::GUI threadsafe
        sub Win32::GUI::CLONE_SKIP {1};
        sub Win32::GUI::Timer::CLONE_SKIP {1};

and then below you go on to use a Win32::GUI::NotifyIcon object, that will almost certainly need the same treatment. Win32::GUI::ThreadUtils should add all the necessary CLONE_SKIP definitions to make the whole Win32::GUI package safe(r).

Still got an error, but now another one:
        Thread failed to start: Can't call method "Text" on unblessed
reference at Smoothwall Remote.pl line 794.
        Attempt to free non-existent shared string 'Tray', Perl interpreter:
0x1cec67c at C:/Perl/site/lib/Win32/GUI.pm line 3429 during global
destruction.
        Unbalanced string table refcount: (1) for "" during global
destruction.
        Unbalanced string table refcount: (1) for "DELETE" during global
destruction.
        Scalars leaked: -1
Tray is the name of my NotifyIcon, tried to comment it out but I'm still
getting the same error :?

Without a short, complete example that we can run so that we can see the problem, it's very difficult to tell if this is a Win32::GUI problem or not.

2) Hide() vs -Visible => 0

I'm working with tabstrips, and on tabstrip_change, I hide some labels and
textboxes to show others.
I was doing this with "$main_window->label->Hide()", but to shorten some
code I tried to do it like "$main_window->label->Change(-visible => 0)".
But this doesn't work completely: the main window doesn't get updated (you
don't see any changes). But if I place "$main_window->Hide();
$main_window->Show();" right after, the changes get updated, but with some
flickering (I tried "$main_window->Update();" too, but this doesn't seem to
do anything).
Do I miss something?

Not really. $window->Change(-visible => 0); only toggles the WS_VISIBLE style bit - a redraw is needed to reflect the change. This might be considered a bug.

Regards,
Rob.

Reply via email to