WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

Access control in a child

View: New views
4 Messages — Rating Filter:   Alert me  

Access control in a child

by dwinkjr :: Rate this Message:

| View Threaded | Show Only this Message

ok I am new to the whole Win32::Gui stuff.. But here is my problem.  I am trying to load a combobox with ODBC datasources.  The problem I am having is that the combobox is a child.  I cant seem to address it correctly.  Here is my code.
my $GB3 = Win32::GUI::Groupbox->new($Win,
       -text    => "Database Parameters:",
       -name    => "GroupBox_3",
       -left    => 12,
       -top     => 151,
       -width   => 349,
       -height  => 174,
      );
my $CB= $Win->AddCombobox(
       -name    => "CBox1",
       -dropdown => 0,
       -left    => 5,
       -top     => 41,
       -width   => 93,
       -height  => 400,
       -parent => $GB3,
      );
my %DataSources = Win32::ODBC::DataSources();
foreach $DSNo ( keys( %DataSources ) )
        {
        my %Config = Win32::ODBC::GetDSN( $DSNo );
        $Win->CBox1->Add($DSNo);
        }

$Win->CBox1->SetCurSel(0);

Can someone help me out here?
Thanks in advance.
Dave W.

Re: Access control in a child

by dwinkjr :: Rate this Message:

| View Threaded | Show Only this Message

Can anyone help me here???
dwinkjr wrote:
ok I am new to the whole Win32::Gui stuff.. But here is my problem.  I am trying to load a combobox with ODBC datasources.  The problem I am having is that the combobox is a child.  I cant seem to address it correctly.  Here is my code.
my $GB3 = Win32::GUI::Groupbox->new($Win,
       -text    => "Database Parameters:",
       -name    => "GroupBox_3",
       -left    => 12,
       -top     => 151,
       -width   => 349,
       -height  => 174,
      );
my $CB= $Win->AddCombobox(
       -name    => "CBox1",
       -dropdown => 0,
       -left    => 5,
       -top     => 41,
       -width   => 93,
       -height  => 400,
       -parent => $GB3,
      );
my %DataSources = Win32::ODBC::DataSources();
foreach $DSNo ( keys( %DataSources ) )
        {
        my %Config = Win32::ODBC::GetDSN( $DSNo );
        $Win->CBox1->Add($DSNo);
        }

$Win->CBox1->SetCurSel(0);

Can someone help me out here?
Thanks in advance.
Dave W.

Re: Access control in a child

by Robert Harris-9 :: Rate this Message:

| View Threaded | Show Only this Message


Use $CB->InsertItem($DSNo);
instead of
$Win->CBox1->Add($DSNo);



dwinkjr <david.wink@...>
Sent by: perl-win32-gui-users-bounces@...

16/04/2008 03:57 PM

To
perl-win32-gui-users@...
cc
Subject
[perl-win32-gui-users]  Access control in a child






ok I am new to the whole Win32::Gui stuff.. But here is my problem.  I am
trying to load a combobox with ODBC datasources.  The problem I am having is
that the combobox is a child.  I cant seem to address it correctly.  Here is
my code.
my $GB3 = Win32::GUI::Groupbox->new($Win,
      -text    => "Database Parameters:",
      -name    => "GroupBox_3",
      -left    => 12,
      -top     => 151,
      -width   => 349,
      -height  => 174,
     );
my $CB= $Win->AddCombobox(
      -name    => "CBox1",
      -dropdown => 0,
      -left    => 5,
      -top     => 41,
      -width   => 93,
      -height  => 400,
      -parent                 => $GB3,
     );
my %DataSources = Win32::ODBC::DataSources();
foreach $DSNo ( keys( %DataSources ) )
                {
       my %Config = Win32::ODBC::GetDSN( $DSNo );
       $Win->CBox1->Add($DSNo);
                }

$Win->CBox1->SetCurSel(0);

Can someone help me out here?
Thanks in advance.
Dave W.
--
View this message in context: http://www.nabble.com/Access-control-in-a-child-tp16732261p16732261.html
Sent from the perl-win32-gui-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@...
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@...
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Re: Access control in a child

by Cloud Strife :: Rate this Message:

| View Threaded | Show Only this Message


dwinkjr wrote:
ok I am new to the whole Win32::Gui stuff.. But here is my problem.  I am trying to load a combobox with ODBC datasources.  The problem I am having is that the combobox is a child.  I cant seem to address it correctly.  Here is my code.
my $GB3 = Win32::GUI::Groupbox->new($Win,
       -text    => "Database Parameters:",
       -name    => "GroupBox_3",
       -left    => 12,
       -top     => 151,
       -width   => 349,
       -height  => 174,
      );
my $CB= $Win->AddCombobox(
       -name    => "CBox1",
       -dropdown => 0,
       -left    => 5,
       -top     => 41,
       -width   => 93,
       -height  => 400,
       -parent => $GB3,
      );
my %DataSources = Win32::ODBC::DataSources();
foreach $DSNo ( keys( %DataSources ) )
        {
        my %Config = Win32::ODBC::GetDSN( $DSNo );
        $Win->CBox1->Add($DSNo);
        }

$Win->CBox1->SetCurSel(0);

Can someone help me out here?
Thanks in advance.
Dave W.
Try $CB->Add($DSNo) instead $Win->CBox1->Add($DSNo);